This is my code
audioViewController *voiceRecorder = [audioViewController sharedManager];
[voiceRecorder stopRecording];
NSString *msg = [NSString stringWithFormat:@"Want to logout?"];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Info"
message:msg
delegate:self
cancelButtonTitle:@"No"
otherButtonTitles:@"Yes", nil];
alert.tag = 100;
[alert show];
I am calling sharedManager in one of my view controller. The problem is, my alertview runs before sharedManager method executes, if you check my code, i have called "StopReording" method, but when i run the code, it works after showing alert. Anyone has idea, how do I show alert only after the method returns something.?