小编tge*_*ski的帖子

Xcode 7,Swift 2.0,Carthage

升级到之后Xcode 7.0,我将所有项目转换为Swift 2.0.但是我无法更新Carthage库.我收到这个警告:

无法在以下位置加载插件:/ Users/Alexandr/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin,跳过.失败的原因:*** - [__ NSPlaceholderDictionary initWithObjects:forKeys:count:]:尝试从对象[0]插入nil对象

还有几个错误:

Box/Box.swift:6:37:错误:'Printable'已重命名为'CustomStringConvertible'/Box/Box.swift:31:10:错误:'toString'已重命名为'String'Box/MutableBox.swift :8:51:错误:'Printable'已重命名为'CustomStringConvertible'Box/MutableBox.swift:25:10:错误:'toString'已重命名为'String'

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

github "Alamofire/Alamofire" 
github "SwiftyJSON/SwiftyJSON" 
github "ReactiveCocoa/ReactiveCocoa"
Run Code Online (Sandbox Code Playgroud)

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

~ xcodebuild -version
Xcode 7.0
Build version 7A220
~ carthage version
0.9.1
Run Code Online (Sandbox Code Playgroud)

编辑:

接缝Alamofire并且SwiftyJSON已经支持Swift 2.0.因为ReactiveCocoa我们需要添加分支"swift2".

github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "ReactiveCocoa/ReactiveCocoa" "swift2"
Run Code Online (Sandbox Code Playgroud)

xcode ios swift carthage

5
推荐指数
1
解决办法
1225
查看次数

Xcode 7更新后,UIViewController类型的值没有成员topViewController

在我更新到Xcode 7后,我收到此错误"类型的值UIViewController没有成员topViewController." 其他人遇到这个?是topViewController不再的一部分UIViewController

 override func viewDidLoad() {
    super.viewDidLoad()
    self.navigationItem.leftBarButtonItem = self.editButtonItem()
    let addButton = UIBarButtonItem(barButtonSystemItem: .Search,
        target: self, action: "addButtonPressed:")
    self.navigationItem.rightBarButtonItem = addButton

    if let split = self.splitViewController {
        let controllers = split.viewControllers
        self.detailViewController =
            controllers[controllers.count-1].topViewController as? ### Error heres
        DetailViewController
    }

    model = Model(delegate: self) // create the Model
    model.synchronize() // tell model to sync its data
    self.navigationController?.toolbarHidden = false;
    self.navigationItem.backBarButtonItem = UIBarButtonItem(title:"Home", style:.Plain, target:nil, action:nil)
}
Run Code Online (Sandbox Code Playgroud)

swift xcode6 ios9 xcode7 swift2

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

swift ×2

carthage ×1

ios ×1

ios9 ×1

swift2 ×1

xcode ×1

xcode6 ×1

xcode7 ×1