2011-06-25 45 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); 

}