Uiimagepickercontroller iPad IOS5上的UIImagePicker崩溃

Uiimagepickercontroller iPad IOS5上的UIImagePicker崩溃,uiimagepickercontroller,Uiimagepickercontroller,有人知道这个代码有什么问题吗 UIImagePickerControllerSourceType pickerType = UIImagePickerControllerSourceTypePhotoLibrary; UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; [imagePicker setSourceType:pickerType]; [imagePicker setMedi

有人知道这个代码有什么问题吗

UIImagePickerControllerSourceType pickerType = UIImagePickerControllerSourceTypePhotoLibrary;

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

[imagePicker setSourceType:pickerType];
[imagePicker setMediaTypes:[UIImagePickerController availableMediaTypesForSourceType:pickerType]];
[imagePicker setDelegate:self];

UIPopoverController *pop = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
[pop setDelegate:self];
[pop presentPopoverFromRect:CGRectMake(100, 100, 100, 100) inView:self permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[pop setPopoverContentSize:CGSizeMake(300, 500)];
在ios4上,它运行良好。但在ios5/ipad上,它崩溃了

*** Assertion failure in -[PLHighlightingTableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:6072
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
当我滚动图像选择器时发生异常

有什么想法吗

问候


-dezember

我想我发现了问题:
[pop setPopoverContentSize:CGSizeMake(300500)]似乎是问题所在。没有这条线它不会崩溃。现在的问题是:这是iOS 5中的一个错误吗?不确定这是否有用,因为这不是您描述的确切问题,但我发现对setPopoverContentSize:的某些调用会导致iOS 4和iOS 5中不同的显示大小……这当然非常令人沮丧。就像我说的,不一定有用,只是它表明在iOS5中对该方法进行了更改。我的投票:可能是个错误。