美文网首页
UIAlertController会导致push失败等问题

UIAlertController会导致push失败等问题

作者: ing_69c7 | 来源:发表于2017-12-06 14:12 被阅读0次

我今天遇到个坑爹的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];

};

务必在UIAlertController dismiss成功后再push界面

相关文章

网友评论

      本文标题:UIAlertController会导致push失败等问题

      本文链接:https://www.haomeiwen.com/subject/yggkixtx.html