当我尝试从照片库中读取图像时,出现了错误:“超过最大限制的5个筛选相册列表尝试注册。 这将失败。”无法读取图像。
有什么想法可以解决这个问题吗?
当我尝试从照片库中读取图像时,出现了错误:“超过最大限制的5个筛选相册列表尝试注册。 这将失败。”无法读取图像。
有什么想法可以解决这个问题吗?
我认为你没有检查源类型。 你可能正在执行
self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
如果是这种情况,那么您必须在直接进行赋值之前检查源类型,例如:
if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypePhotoLibrary])
{
// Set source to the Photo Library
self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
}
希望它有所帮助
不要这样做
self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
使用
self.sourceType =UIImagePickerControllerSourceTypeSavedPhotosAlbum;
这对我很有帮助:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
picker = nil;
UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"];
}
需要帮助请访问链接:http://skhousee.blogspot.in/2012/06/error-more-than-max-5-filtered-album.html
UIImagePickerController *ipc = [[UIImagePickerController alloc] init];
ipc.delegate = self;
ipc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:ipc animated:YES];
[ipc release];
-(void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self setModalInPopover:YES];
}
当分配并显示UIImagePickerController超过5次时,就会出现这种情况...我猜IOS在释放/关闭UIImagePickerController时忘记注销某些内容。
答案是问题只在iOS 5 Beta 6中显示出来。更新到beta 7后,问题现在已经消失了。