To invoke some code from the main queue thread in iOS use the following code:

dispatch_async(dispatch_get_main_queue(), ^{ /* some code like show an alert view */ });