想要实现点击tableview中的一个cell,弹出一个页面,代码如下:
- HSLoginViewController
*loginVC = [HSLoginViewController new]; - [self
presentViewController:loginVC animated:YES completion:nil];
结果页面弹出速度非常慢,有时几秒钟才能弹出,又是根本不弹出,直到在页面上随意再次点击一下才弹出。
将代码做如下修改后,问题解决:
- dispatch_async(dispatch_get_main_queue(),
^{ -
HSLoginViewController *loginVC = [HSLoginViewController new]; -
[self presentViewController:loginVC animated:YES completion:nil]; -
});