Background
- Navigation Controller View
- Table with cells having ftp information
- Cell segue will connect to ftp server and show lists
- shouldPerformSegueWithIdentifier will check if server's connection condition
- if it's able to connect to the ftp server, it it will perform prepareForSegue
When a cell is clicked, I am showing HUD with "connecting..." and when it verifies, push to next page.
Problem : HUD doesn't show up right away and shows right before it's pushing to next view. Tried with various different HUD just in case, but fails. I am sure it's not the HUD.
Question : How can I start HUD right away upon click cell? Is shouldPerformSegueWithIdentifier a right place to start show HUD? I tried with dispatch_async or sync but I have to return YES/NO to should perform segue or not.
-(BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
{
if([identifier isEqual:@"ConnectServer"])
{
self.HUD = self.prototypeHUD;
self.HUD.textLabel.text = @"Connecting...";
[self.HUD showInView:self.navigationController.view];
NSManagedObject *obj = self.serverList[[self.tableView indexPathForSelectedRow].row];
return [self checkServerConnection:obj];
}
}