Ios XCode 6.3 Swift转换错误
XCode已经更新,并有了新的Swift更新 我有以下代码:Ios XCode 6.3 Swift转换错误,ios,xcode,swift,Ios,Xcode,Swift,XCode已经更新,并有了新的Swift更新 我有以下代码: // load new tappable from file and place it on top of the screen beyond of sight tappable05 = CCBReader.load("Tappable") as Tappable tappable05.position = ccp(pipeSlim05.contentSize.width * 0.5,
// load new tappable from file and place it on top of the screen beyond of sight
tappable05 = CCBReader.load("Tappable") as Tappable
tappable05.position = ccp(pipeSlim05.contentSize.width * 0.5,
pipeSlim05.contentSize.height * 1.03)
tappable05.scale = 1.2
//randomize tappable color
tappable05.setRandomColor()
// setup zOrder
tappable05.zOrder = DrawingOrder.DrawingOrderTappable.rawValue
// add new tappable to scene
pipeSlim05.addChild(tappable05)
我得到了这个错误:
CCNode! is not convertible to 'Tappable;' dod you mean to use 'as!'
这是1.2中最常见的更改,降级需要 有一个转换器可以解决这个问题,如下所示:
或者使用快速修复,但这是一个不必要的麻烦。是的。Swift 1.2(在Xcode 6.3中)的新下载现在需要
as代码>。您是否尝试将其更改为as!Tappable
?请使用随附的转换器。它会解决所有这些问题。