【发布时间】:2016-08-17 18:22:08
【问题描述】:
OSX 10.11, Swift 2.2, Realm 0.99
我已经使用 Carthage 安装了 Realm。
let realm = try! Realm() 抛出一个NSException:
libc++abi.dylib:以NSException 类型的未捕获异常终止
项目编译、构建和运行,直到 Realm 实例化。 两个领域框架文件都在项目的嵌入式二进制文件和嵌入式框架中。 它们位于 Carthage/Build/IOS 文件夹中。 它们也出现在构建阶段的带库部分的链接二进制文件中。
非常感谢您的帮助。
领域安装:
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*
【问题讨论】: