Warning: Attempt to present <UIImagePickerController: 0x292b400> on xxx which is already presenti
来源:互联网 发布:江恩时间周期理论,知乎 编辑:程序博客网 时间:2024/06/05 15:22
iOS8中使用 UIActionSheet 跳转到相机出错. UIActionSheet : UIView
// UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead
比如在弹出的actionsheet中选择从相册选择图片或者拍照,之后弹出UIImagePickerController进行选择。
在iOS8以前的方法里,直接在Click的委托事件里处理就好了,
-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;
但是在iOS8,系统会抛出警告,并且取消弹出ImagePicker行为。
Warning: Attempt to present <UIImagePickerController: 0x15c8a0000> on <WCProfileController: 0x15c53cc50> which is already presenting (null)
原因在警告里说得比较明白了,因为已经有actionsheet存在了,不能present新的。此时我们选择新的委托方法didDismissWithButtonIndex方法即可。
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex;
0 0
- Warning: Attempt to present <UIImagePickerController: 0x292b400> on xxx which is already presenti
- Warning: Attempt to present UINavigationController on NavigationController which is already presenti
- iOS - 解决Warning: Attempt to present <UIImagePickerController: 0x7f9ba106a000>which is already presen
- Warning: Attempt to present <...> on <…> which is already presenting null
- 项目中遇到的问题(一)弹出UIAlertController 时出现 Warning: Attempt to present * on * which is already presenting
- WKwebview弹框报错Attempt to present <UIAlertController> on <XX>which is already presenting (null)
- Warning: Attempt to present <NextViewController: 0x10966fed0> on
- iOS: Warning: Attempt to present <ModalViewController> on <ViewController>while a presentation is in
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present * on * whose view is not in the window hierarchy!
- Warning: Attempt to present xx on yy whose view is not in the window hierarchy!
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Android ORM数据库框架之-greenDao(三)
- 寄存器某一位置位或者清零
- C++ 虚函数表解析
- 【codevs1074】食物链
- 使用Drip协议、例子程序、不同ID烧录不同节点
- Warning: Attempt to present <UIImagePickerController: 0x292b400> on xxx which is already presenti
- 解析init.rc
- UITouch详解
- Linux常用命令
- 对于代码,越害怕写错就越写不敢写,然而带来的很明显是技术的滞留...
- 翻译:Fast Exact Shortest-Path Distance Queries on LargeNetworks by Pruned Landmark Labeling
- Git相关
- [小笔记]Android 调节音乐音量大小&改变闹钟铃声大小
- 常用模块的测试用例(登录,添加,删除,查询)