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

ios – Xcode 7,Swift 2.0,Carthage

发布时间:2020-12-14 19:19:35 所属栏目:百科 来源:网络整理
导读:升级到 Xcode 7.0后,我将所有项目转换为 Swift 2.0.但我不能更新迦太基图书馆.我收到这个警告: Failed to load plugin at: /Users/Alexandr/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin,skipping. Reason for failur
升级到 Xcode 7.0后,我将所有项目转换为 Swift 2.0.但我不能更新迦太基图书馆.我收到这个警告:

Failed to load plugin at: /Users/Alexandr/Library/Application
Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin,skipping.
Reason for failure: *** -[__NSPlaceholderDictionary
initWithObjects:forKeys:count:]: attempt to insert nil object from
objects[0]

还有几个错误:

Box/Box.swift:6:37: error: ‘Printable’ has been renamed to
‘CustomStringConvertible’ /Box/Box.swift:31:10: error: ‘toString’ has
been renamed to ‘String’ Box/MutableBox.swift:8:51: error: ‘Printable’
has been renamed to ‘CustomStringConvertible’
Box/MutableBox.swift:25:10: error: ‘toString’ has been renamed to
‘String’

我如何使用Swift 2.0版本的框架?我的carthage文件看起来像:

github "Alamofire/Alamofire" 
github "SwiftyJSON/SwiftyJSON" 
github "ReactiveCocoa/ReactiveCocoa"

在框架结束时添加“swift 2.0”无法正常工作.

~ xcodebuild -version
Xcode 7.0
Build version 7A220
~ carthage version
0.9.1

编辑:

Seams Alamofire和SwiftyJSON已经支持Swift 2.0.对于ReactiveCocoa,我们需要添加分支“swift2”.

github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "ReactiveCocoa/ReactiveCocoa" "swift2"

解决方法

首先,你有什么Cartage版本?
运行命令

Carthage version

我认为最新的稳定版是0.8.0,如果您有旧版本,我建议您升级它.
这样做跑

brew upgrade carthage

在那之后检查你使用的所有库是否支持Swift 2.0,如果没有检查来自master的不同分支,也许他们还没有合并它们.

我刚看到你运行0.9.1,也许它有问题?我使用0.8.0并且与Alamofire一起使用

(编辑:李大同)

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

    推荐文章
      热点阅读