2016-01-05 51 views
-2

我下面就如何使空间游戏斯威夫特一个tutorial,当我输入下面的代码它说:“没有解决identifier'lastYieldInterval的使用”使用未解决的标识符“lastYieldIdentifier”

func updateWithTimeSinceLastUpdate(timeSinceLastUpdate: CFTimeInterval) 
{ 
    lastYieldInterval += timeSinceLastUpdate 
    if lastYieldInterval > 1 
    { 
     lastYieldInterval = 0 
     addAlien() 

    } 
} 
+6

凡定义'lastYieldInterval'? – Larme

回答

1

根据在tutorial,你应该用lastYieldTimeInterval代替lastYieldInterval

var lastYieldTimeInterval:NSTimeInterval = NSTimeInterval() 

// ... 

func updateWithTimeSinceLastUpdate(timeSinceLastUpdate:CFTimeInterval){ 
    lastYieldTimeInterval += timeSinceLastUpdate 
    if (lastYieldTimeInterval > 1){ 
     lastYieldTimeInterval = 0 
     self.addAlien() 
    } 
} 
相关问题