ios - Access IBOutlet inside dispatch_async block -


it doesn't hide label if call inside dispatch blocks:

dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{         //here non-main thread.         [self.loading sethidden:no];           dispatch_async(dispatch_get_main_queue(), ^{             //here returns main thread.             [self.loading sethidden:no];         });     }); 

this works, still not hiding:

 [self.loading sethidden:no]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{         //here non-main thread.            dispatch_async(dispatch_get_main_queue(), ^{             //here returns main thread.             [self.loading sethidden:no];         });     }); 

how can access iboutlets inside blocks?

you never calling sethidden:yes hide it. plus, interface, should on main thread.


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -