【问题标题】:Get image from photo library for multiple times shows error从照片库中获取图像多次显示错误
【发布时间】:2012-08-22 23:17:30
【问题描述】:

在我的 iPhone 应用程序中,当我使用 UIImagePickerControllerSourceTypePhotoLibrary 作为源类型时,打开它 5 次后,我得到:

<Error>: More than maximum 5 filtered album lists trying to register. This will fail.

在我的控制台中。而且选择的图像也不见了。

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]==YES) {

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;    
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release]; 
}

在方法中:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

我关闭了 modalviewController。

【问题讨论】:

    标签: objective-c ios5 uiimagepickercontroller


    【解决方案1】:

    与创建多个 UIImagePickerControllers 有关。您一次只提供一个图像选择器控制器,所以也许您应该在第一次调用您的 grabImage 时创建一个,然后重复使用它,而不是每次都创建一个新的。

    参考thisthis 以及this 链接

    【讨论】:

    • 我在 viewDidLoad 方法中初始化了它,它只分配一次,在 dealloc 方法中释放
    • 我认为最好忽略它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多