FancyPixel / done-swift

Sample app to demonstrate data sharing between a WatchKit app and its main app using Realm
MIT License
149 stars 24 forks source link

not loading linker command failed with exit code 1 (use -v to see invocation) #4

Open Ged2323 opened 8 years ago

Ged2323 commented 8 years ago

This is with latest realm realm-swift-0.97-4.0 - Xcode 7.2 , swift 2.1.1

WatchKit has this error on ln 22: 'stringByAppendingPathComponent' is unavailable: Use URLByAppendingPathComponent on NSURL instead.

I fixed this with this:

let directory: NSURL = NSFileManager.defaultManager().containerURLForSecurityApplicationGroupIdentifier("group.realm.testing23")!
        let realmPath = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("db.realm")

        //let realmPath = directory.path!.stringByAppendingPathComponent("db.realm")
        RLMRealm.setDefaultRealmPath(realmPath.absoluteString)

Please check. :)

then this error once all the groups are set up:

ld: building for watchOS, but linking against dylib built for iOS, file '"mylocation"RealmSwift.framework/RealmSwift' for architecture armv7k clang: error: linker command failed with exit code 1 (use -v to see invocation)