【问题标题】:Swift Realm: creating instance of Realm throws NSExceptionSwift Realm:创建 Realm 实例抛出 NSException
【发布时间】: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*  

【问题讨论】:

    标签: ios swift realm


    【解决方案1】:

    天哪,问题是类中的非可选声明。 不知为何抓不到。完全浪费时间。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-26
      • 1970-01-01
      • 1970-01-01
      • 2015-11-20
      • 1970-01-01
      相关资源
      最近更新 更多