我想在closestStation函数开始之前隐藏multipleSearchView,但没有成功,它隐藏但在closestStation完成后
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
*)indexPath
{
if (tableView == self.localityTableView){
[self.multipleSearchView setHidden:TRUE];
[self closestStation:locality.latitude :locality.longitude];
}
}
- (void) closestStation :(float) latitude :(float) longitude{
// this function takes 3 or 4 second
}
最佳答案
那是因为你在主队列中有一个繁重的操作。将您的 -closestStation:
放入后台队列来解决此问题。
关于ios - 我无法在功能完成之前隐藏 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18724268/