我正在尝试在我的应用程序中使用UIImagePickerController,并在第一次提示访问相册后发生崩溃。这是崩溃错误:
[PUUIAlbumListViewController requiresAuth]:无法识别的选择器发送到实例0xd6a18b0
我无法在任何地方找到任何对此错误的引用。有人有任何线索吗?谢谢!
-(void)showPicker
{
self.imagePicker = [[UIImagePickerController alloc]init];
self.imagePicker.delegate = self;
self.imagePicker.allowsEditing = NO;
self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.imagePicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
self.imagePicker.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:self.imagePicker animated:YES completion:nil];
}
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PUUIAlbumListViewController requiresAuth]: unrecognized selector sent to instance 0xd1587d0'
*** First throw call stack:
(
0 CoreFoundation 0x03bcb5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0394e8b6 objc_exception_throw + 44
2 CoreFoundation 0x03c68903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x03bbb90b ___forwarding___ + 1019
4 CoreFoundation 0x03bbb4ee _CF_forwarding_prep_0 + 14
5 MyApp Mobile 0x000042e8 -[MyAppDelegate applicationDidBecomeActive:] + 2989
6 UIKit 0x027afef4 -[UIApplication _stopDeactivatingForReason:] + 329
7 UIKit 0x027b5afb _alertItemStateChanged + 81
8 CoreFoundation 0x03c27733 __CFNotificationCenterAddObserver_block_invoke + 163
9 CoreFoundation 0x03c27524 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
10 CoreFoundation 0x03c277fd ____CFXNotificationPostToken_block_invoke + 173
11 CoreFoundation 0x03b8a1c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
12 CoreFoundation 0x03b533f9 __CFRunLoopDoBlocks + 361
13 CoreFoundation 0x03b71843 __CFRunLoopRun + 2355
14 CoreFoundation 0x03b70ac3 CFRunLoopRunSpecific + 467
15 CoreFoundation 0x03b708db CFRunLoopRunInMode + 123
16 GraphicsServices 0x0477f9e2 GSEventRunModal + 192
17 GraphicsServices 0x0477f809 GSEventRun + 104
18 UIKit 0x027b6d3b UIApplicationMain + 1225
19 MyApp 0x00166361 main + 264
20 libdyld.dylib 0x0431e725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
答案 0 :(得分:0)
看起来崩溃直接与UIImagePickerController无关,但是当在self.navigationController.visibleViewController上调用选择器而没有检查visibileViewController是否响应选择器时,在applicationDidBecomeActive的appdelegate中发生了崩溃。
答案 1 :(得分:0)
您的代码正在寻找一个方法:您的类中的requiresAuth:PUUIAlbumListViewController。它不在那里。对丢失的方法进行编码或删除对它的调用。