ios - Updating UIButton border color will delay? -
we using bluetooth communication send notification when connected main view controller, notification :
- (void) receiveblenotification:(nsnotification *) notification { if ([[notification name] isequaltostring:@"bluetooth"]) { //here log title right on time next happen after while nslog(@"!!!!!!!"); l1.layer.bordercolor=[globals sharedglobals].maincolor.cgcolor; l2.layer.bordercolor=[globals sharedglobals].maincolor.cgcolor; so reason color changed 6 seconds after log.
is there way force change ?
solved :
dispatch_async(dispatch_get_main_queue(), ^{ //here update required ui });
Comments
Post a Comment