1
@implementation demoScene{
-(void) initializeScene {
moon *_moon=[[moon alloc]init];
}
-(void) updateBeforeTransform: (CC3NodeUpdatingVisitor*) visitor {
deltaTime =deltaTime+visitor.deltaTime;
NSLog(@"delta time=%0.12f",deltaTime);
[_moon print:deltaTime/100000];
}
@end
這是我的問題。「未使用的變量」
我想在initializeScene
方法中從月球類創建一個對象,並且我想發送消息給updateBeforeTransform
方法中的那個對象。
當我鍵入這樣的代碼時,我無法發送消息到_moon
對象並獲得「未使用的變量」警告消息。
我知道對象超出了範圍,但如果我需要發送消息從updateBeforeTransform
方法。並且方法在一秒鐘內被稱爲60次。所以我不想在一秒鐘內創建一個對象60次。
任何建議,將不勝感激。
語法錯誤!擺脫'@ implementation'塊的大括號。 – Linuxios