Finally, I got to manage the issue using NSThread.
Actually, I was calling one method named -postForEditDispatch
from my -saveButtonTapped
method. I created one separate thread using -detachNewThreadSelector:toTarget:withObject:
and tried to call that method on that thread.
Sample Code :
- (IBAction)saveButtonTapped:(id)sender
{
NSLog(@"Modal Save Pressed.");
[SVProgressHUD showWithStatus:@"Loading..."];
// Some other code...
[NSThread detachNewThreadSelector:@selector(postForEditDispatch:) toTarget:self withObject:nil];
}