I don't have Xcode with me, but I'll take a stab at it anyway. Your problem is because the alert won't show until the main loop iterates. And it won't iterate until your getData
method is executed since you're doing this on the main thread. So you need to fork.
Try wrapping your if()
in something like this:
dispatch_async(dispatch_get_main_queue(),
^ {
if([app getData]){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil
message:@"Data is downloaded."
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
});