您的位置:首页 > 移动开发 > IOS开发

iOS - 解决Warning: Attempt to present <> which is already presenting <>

2017-04-24 14:46 3207 查看
Warning: Attempt to present < LXFPhotoHelper: 0x1049b5e00 > on < UIApplicationRotationFollowingController: 0x101bd4fc0 > which is already presenting < UIAlertController: 0x101e63100 >

问题

提示我们在弹出LXFPhotoHelper之前已经弹出UIAlertController这个控制器了,那我们就让弹出的操作放到UIAlertController消失之后即可。

解决方法

将方法

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;


替换为

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;


即可解决

// UIActionSheet的替换对应这个
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios
相关文章推荐