UIPopoverController:当弹出窗口仍然可见时达到dealloc

编程入门 行业动态 更新时间:2024-10-28 14:29:05
本文介绍了UIPopoverController:当弹出窗口仍然可见时达到dealloc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一款可让用户从自己的相册中选择图片的应用。它适用于iPhone,但不适用于iPad。

I am working on an app that lets the user select images from his own photo album. It works on iPhone, but not on iPad.

我做了一个 UIPopoverController ,一切正常,用户可以选择一张照片,但是当用户按USE按钮。应用程序兑现了一个说法

I made a UIPopoverController, and it all works fine, the user can pick a photo, but when the user pushes "USE" button. the app cashes a says

UIPopoverController dealloc]当popover仍然可见时

UIPopoverController dealloc] reached while popover is still visible

这里是代码:

- (void)choosePhotoFromLibraryipad:(id)sender{ if(![popoverController isPopoverVisible]){ imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagePicker.delegate = self; imagePicker.allowsEditing = YES; self.popoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker]; [self.popoverController presentPopoverFromRect:CGRectMake(0.0, 0.0, 400.0, 400.0) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES ]; } }

推荐答案

检查 .h 文件。确保 popoverController 的 @property 为 strong 而不是弱 。一个小时的时间浪费在这样的简单事情上。

Check your .h file. Make sure that your @property for your popoverController is strong instead of weak. Many an hour of time has been wasted over simple things like this.

更多推荐

UIPopoverController:当弹出窗口仍然可见时达到dealloc

本文发布于:2023-11-28 00:14:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640187.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹出窗口   UIPopoverController   dealloc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!