加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Realm Swift OSX Cocoapods示例应用程序崩溃

发布时间:2020-12-14 05:38:10 所属栏目:百科 来源:网络整理
导读:我的步骤是: 1)在Xcode中,我创建了一个新的命令行OSX Swift应用程序并添加了他们的示例“class Dog”代码,并在顶部添加了“import RealmSwift”. 2)我添加一个包含两行的Podfile,“use_frameworks
我的步骤是:

1)在Xcode中,我创建了一个新的命令行OSX Swift应用程序并添加了他们的示例“class Dog”代码,并在顶部添加了“import RealmSwift”.

2)我添加一个包含两行的Podfile,“use_frameworks!”和“pod’FynmSwift’”然后运行pod安装.

3)我打开工作区,编译并运行.我收到这个警告:

Not running swift-stdlib-tool: EMBEDDED_CONTENT_CONTAINS_SWIFT is enabled,but the product type ‘Command-line Tool’ is not a wrapper type.

而这次崩溃:

dyld: Library not loaded: @rpath/libswiftAppKit.dylib
Referenced from: /Users/ys1382/Library/Developer/Xcode/DerivedData/testRealmApp-gxysfwfiirxwddbklmbolznecnld/Build/Products/Debug/RealmSwift.framework/Versions/A/RealmSwift
Reason: image not found

到目前为止,谷歌搜索表明警告和崩溃是相关的.有什么建议?

我正在使用OSX El Capitan,Xcode 7.2.1,Cocoapods 0.39.0

TiM的评论让我发现,在撰写本文时,几乎不可能将框架添加到Swift命令行应用程序中. This blog post描述了一种方法.从第1步开始,它说:
  1. Create an Objective-C command line tool and change the Search Paths.
    Not Swift. You can create a Swift framework for the code you’d put in your command line tool,but the tool itself must not compile any Swift code. Doing so will confuse the linker and make it see duplicate declarations of the Swift library (one in the shipped .dylib,another embedded in the command line tool).

This presentation显示了一种不同的方法,从创建Cocoa应用程序开始,然后以31个步骤将其强制转换为命令行应用程序.

就在那时我想,“mmmaybe我的命令行工具毕竟可以使用一些漂亮的图形”,而是制作了一个Cocoa OSX Swift Realm Cocoapod应用程序.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读