I am trying to perform an operation on a background thread. In the past i have used
[self performSelectorInBackground: @selector (getSetDisplay) withObject: nil];
to accomplish this. However, I have registered for this function to be executed within an NSNotification and I need to animate the UIActivityIndicator. The UIActivityIndicator (from what I understand) needs to run on the main thread, but this notification is doing that as well and is blocking it.
- (IBAction) btnRefresh_clicked :(id)sender{
[activity startAnimating];
[navigationUpdateFromDetail setUpdate: NO];
[navigationUpdateFromDetail.locationManager startUpdatingLocation];
[[NSNotificationCenter defaultCenter] addObserver: self selector : @selector (getSetDiplay) name: @"LocationUpdated" object: nil];
}
does anyone have an idea about how to get this running on a background thread? thanks is advance.