开发者

iPhone SDK - Async Behavior?

I have a IBAction that looks like this:

self.title = @"Logging开发者_Python百科 in ...";
[MyClass myLongRunningOperation];

My Problem is that the view controller title does not get updated until the long running operation has finished. It seems like its put in a queue for later, while my long running operation executes right away.

I'm pretty new to the plattform, so forgive my ignorance here.

Thanks, -- Felix


You're blocking the UI thread. Consider using

[self performSelectorOnBackgroundThread:@selector(doLongRunningOperation) withObject:nil];

You probably really want to read the Threading Programming Guide at some point.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜