Xcode7,Swift2.0,迦太基
Xcode 7, Swift 2.0, Carthage
升级到 Xcode 7.0
后,我将所有项目转换为 Swift 2.0
。但我无法更新 Carthage
库。我收到此警告:
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
版本的框架?我的迦太基文件如下所示:
github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "ReactiveCocoa/ReactiveCocoa"
在 framwork 末尾添加 "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
一起正常工作
通过将以下内容放入我的 Cartfile 为我工作:
github "ReactiveCocoa/ReactiveCocoa" >= 4.0
目前 v4.x 的 ReactiveCocoa 处于 alpha 但 v3.x 不支持 Swift 2
升级到 Xcode 7.0
后,我将所有项目转换为 Swift 2.0
。但我无法更新 Carthage
库。我收到此警告:
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
版本的框架?我的迦太基文件如下所示:
github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "ReactiveCocoa/ReactiveCocoa"
在 framwork 末尾添加 "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
一起正常工作通过将以下内容放入我的 Cartfile 为我工作:
github "ReactiveCocoa/ReactiveCocoa" >= 4.0
目前 v4.x 的 ReactiveCocoa 处于 alpha 但 v3.x 不支持 Swift 2