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

我的步骤是:

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应用程序.

相关文章

软件简介:蓝湖辅助工具,减少移动端开发中控件属性的复制和粘...
现实生活中,我们听到的声音都是时间连续的,我们称为这种信...
前言最近在B站上看到一个漂亮的仙女姐姐跳舞视频,循环看了亿...
【Android App】实战项目之仿抖音的短视频分享App(附源码和...
前言这一篇博客应该是我花时间最多的一次了,从2022年1月底至...
因为我既对接过session、cookie,也对接过JWT,今年因为工作...