OSX 10.11, Swift 2.2, Realm 0.99
我已经使用 Carthage 安装了 Realm。
let realm = try! Realm()
抛出一个 NSException
:
libc++abi.dylib
:以 NSException
类型的未捕获异常终止
项目编译、构建并运行,直到 Realm 实例化。 两个 Realm 框架文件都在项目的嵌入式二进制文件和嵌入式框架中。 它们位于 Carthage/Build/IOS 文件夹中。 它们还出现在构建阶段的带库部分的链接二进制文件中。
非常感谢您的帮助。
Realm 安装:
Install Carthage 0.9.2 or later.
Add github "realm/realm-cocoa" to your Cartfile.
Run carthage update.
Drag RealmSwift.framework and Realm.framework from the appropriate platform directory in Carthage/Build/ to the “Embedded Binaries” section of your Xcode project’s “General” settings.
iOS/watchOS/tvOS: On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”.
Create a Run Script with the following contents:
/usr/local/bin/carthage copy-frameworks
and add the paths to the frameworks you want to use under “Input Files”, e.g.:
$(SRCROOT)/Carthage/Build/iOS/Realm.framework
$(SRCROOT)/Carthage/Build/iOS/RealmSwift.framework*
最佳答案
哦,亲爱的,问题是类中的非可选声明。 不知为什么那不能被捕获。完全是浪费时间。
关于ios - swift Realm : creating instance of Realm throws NSException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36822298/