Saturday 15 September 2012

ios - UI not updating in main thread -


This is really driving me crazy.

I have a button, and if that button has touched the UI will make a way to update this method in question:

  - (zero) loadLevelWithImagePath : (NSString *) ImagePath Difficulty: (int) difficulty ModelName: (NSString *) modelName {// do stuffs}   

/ works}

This works!

However, I'm astonished because when I put a breakpoint in the law, according to Debugger it is already in the main if you put these 2 checks:

  - (zero) loadLevelWithImagePath: (NSString *) ImagePath Difficulty: (int) difficulty ModelName: (NSString *) modelName {NSLog (@ "% D", [NSThread currentThread] == [NSThread mainThread]); Sender_Assic (sender_at_man_que), ^ {NSLog (@ "% d", [NSThread currentThread] == [NSThread mainThread]); // do stuffs}}   

Both TRUE return!

So my question is, why is not UI updated? Thanks a lot!

After the Xt "itemprop =" text ">

this can be a zero problem, though, to make sure you For this reason, it works with dispatch_async and the call is not necessarily the way you call it, it may be that when you call the code Some of your UI objects are zero when you call dispatch_async , then you add a job to the queue, but since all The dispatch queues are in the first place, for the first time the data structures, you actually add jobs at the end of the run loop, which potentially gives time to start (where ever)

No comments:

Post a Comment