2011-06-25 46 views
0

在我的iphone中,我想確保在for循環中連續迭代之間有一些延遲。如何在for循環中添加延遲執行連續迭代?

我該怎麼做?

+1

的[了Thread.sleep可能重複在objective-c](http://stackoverflow.com/questions/829449/thread-sleep-in-objective-c) – ChrisF

+1

只是出於好奇;你爲什麼想這麼做? – uvesten

+0

對不起,我認爲ChrisF是正確的。 –

回答

0

forloopstart {

[self performSelector:@selector(updateTextLabelWithString:) withObject:@"sleep 5 worked" afterDelay:5.0]; 

}

- (無效)updateTextLabelWithString:(的NSString *)theString {

NSLog(@"theString is : %@ \n\n",theString); 

}