UIAlertController会导致push失败等问题
2017-12-06 本文已影响0人
ing_69c7
我今天遇到个坑爹的bug,push界面有的时候可以跳转界面,有的时候不行,一直以为是后台的问题,最后发现是因为UIAlertController控件导致的。
我在使用的时候:
[self.navigationController pushViewController:newController animated:YES];
[alertV dismissViewControllerAnimated:YES completion:nil];
看起来没问题,但它就是出问题了!这样写会导致push失败
正确的写法:
[alertV dismissViewControllerAnimated:YES completion:^{
[self.navigationController pushViewController:newController animated:YES];
};