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
Post a Comment