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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -