2
votes

I declare class

import RealmSwift
class Person: Object {
 dynamic var tmpID = 0
  var name: String { // computed properties are automatically ignored
    return "\(firstName) \(lastName)"
  }
  dynamic var firstName = ""
  dynamic var lastName = ""

  override static func ignoredProperties() -> [String] {
     return ["tmpID"]
  }
}

And when I run my app, Console log:

dyld: Library not loaded: @rpath/RealmSwift.framework/RealmSwift Referenced from: /Users/macbook/Library/Developer/CoreSimulator/Devices/EA7EDDF8-C23C-494A-B702-2AC0F0484F54/data/Containers/Bundle/Application/1E43EC69-375D-4F14-A90D-86AF9728E260/SearchFilm.app/SearchFilm Reason: image not found (lldb)

1
Make sure you've copied RealmSwift.framework to your application's frameworks directory. - segiddins
Go to your Xcode project’s “General” settings. Drag RealmSwift.framework and Realm.framework from the ios/ directory to the “Embedded Binaries” section. Make sure Copy items if needed is selected and click Finish. - Michael Wang

1 Answers

3
votes

Realm used to include a strip-frameworks.sh, that needs to be added as a build script in your projects.

Add this as a build script in your project properties editor under Build Phases

bash ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework/strip-frameworks.sh

Note: I'm using the Swift-2.0 libraries, and this file isn't included. I'll update my answer when I fix my issue for Swift2.0

EDIT

I ended up getting it working in Swift 2.0

I followed all the instructions here, and then added both of the frameworks to be Embedded Binaries like below:

embedded binaries section