我一直在努力目标C代码转换为SWIFT,我已经相当不错到现在为止,我所遇到的方法和返回类型,以这种方法我还没有处理与之前在迅速。方法在迅速与返回类型
updateHUD = [(GameObjectNode *)other collisionWithPlayer:_player];
我有GameObjectNode().collisionWithPlayer(_player)
但仍下落不明other
,我不知道通向哪里。
我一直在努力目标C代码转换为SWIFT,我已经相当不错到现在为止,我所遇到的方法和返回类型,以这种方法我还没有处理与之前在迅速。方法在迅速与返回类型
updateHUD = [(GameObjectNode *)other collisionWithPlayer:_player];
我有GameObjectNode().collisionWithPlayer(_player)
但仍下落不明other
,我不知道通向哪里。
你想:
updateHUD = (other as GameObjectNode).collisionWithPlayer(_player)
在原来的Objective-C代码,(GameObjectNode *)
被调用方法collisionWithPlayer
之前铸造other
那个类型。您正在创建GameObjectNode
的新实例。
请阅读本书迅速和理解铸件/它是如何工作 – 2014-09-13 09:43:54