2013-08-25 45 views
0

如何在啓動後啓動某個功能10秒? 我試過,但它不工作:(x秒後啓動無效

-(void)callFunction:(CCTime)dt 
{ 
NSLog(@"Calling..."); 
} 

[self schedule:@selector(callFunction:) interval:10.0f]; 

CCTime使一個錯誤: 「預期類型」

+1

請訪問http://計算器。 com/a/3614171/2462469 –

+0

感謝您的幫助:) – Nils

+0

可能重複的[如何調用延遲方法](http://stackoverflow.com/questions/9634790/how-to-call-a-method-with -delay) –

回答

1

使用ccTimeCCTime

-(void)callFunction:(ccTime)dt 
{ 
    NSLog(@"Calling..."); 
} 
[self schedule:@selector(callFunction:) interval:10.0f]; 
+0

非常感謝 – Nils