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.
精彩评论