简体   繁体   English

ImagePickerController在Ipad iOS 8.0.2上崩溃,但在iPhone上正常运行

[英]ImagePickerController crashes on Ipad ios 8.0.2 but works fine on iphones

Pls help. Here is my code



    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
    imagePickerController.delegate = self;
    imagePickerController.allowsEditing=NO;
    imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    [self presentViewController:imagePickerController animated:YES completion:nil];


//log is
Incident Identifier: 4EFA5353-D661-465B-8832-48EE31687371
CrashReporter Key:   a71818384f31c76868d9987cbe27b1de500f8b8d
Hardware Model:      iPad2,1
Process:             Xpress [316]
Path:                /private/var/mobile/Containers/Bundle/Application/222A7E73-F4E9-4FD9-8A8B-C51FB01D0660/Xpress.app/Xpress
Identifier:          com.letsxprs.xpress2
Version:             1.0.9 (1.0.9)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-10-17 16:56:08.963 +0530
Launch Time:         2014-10-17 16:56:01.837 +0530
OS Version:          iOS 8.0.2 (12A405)
Report Version:      105

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xd000000c
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x3a352f66 0x3a340000 + 77670
1   UIKit                           0x301f933c 0x2fe19000 + 4064060
2   UIKit                           0x2fefcab2 0x2fe19000 + 932530
3   UIKit                           0x2ff805bc 0x2fe19000 + 1471932
4   PhotosUI                        0x2f786114 0x2f624000 + 1450260
5   PhotosUI                        0x2f725a24 0x2f624000 + 1055268
6   PhotosUI                        0x2f634cdc 0x2f624000 + 68828
7   PhotosUI                        0x2f637c38 0x2f624000 + 80952
8   PhotosUI                        0x2f636dcc 0x2f624000 + 77260
9   PhotosUI                        0x2f63941c 0x2f624000 + 87068
10  PhotosUI                        0x2f63119a 0x2f624000 + 53658
11  UIKit                           0x2fe3df6a 0x2fe19000 + 151402
12  UIKit                           0x2ff9382a 0x2fe19000 + 1550378
13  UIKit                           0x2ffb1c3e 0x2fe19000 + 1674302
14  UIKit                           0x2fed165a 0x2fe19000 + 755290
15  UIKit                           0x2fed145c 0x2fe19000 + 754780
16  UIKit                           0x2fed13f4 0x2fe19000 + 754676
17  UIKit                           0x2fe25d8a 0x2fe19000 + 52618
18  QuartzCore                      0x2f8501d0 0x2f844000 + 49616
19  QuartzCore                      0x2f84bbcc 0x2f844000 + 31692
20  QuartzCore                      0x2f84ba54 0x2f844000 + 31316
21  QuartzCore                      0x2f84b442 0x2f844000 + 29762
22  QuartzCore                      0x2f84b24c 0x2f844000 + 29260
23  QuartzCore                      0x2f845158 0x2f844000 + 4440
24  CoreFoundation                  0x2c970842 0x2c8a2000 + 845890
25  CoreFoundation                  0x2c96df24 0x2c8a2000 + 835364
26  CoreFoundation                  0x2c96e326 0x2c8a2000 + 836390
27  CoreFoundation                  0x2c8bbdac 0x2c8a2000 + 105900
28  CoreFoundation                  0x2c8bbbbe 0x2c8a2000 + 105406
29  GraphicsServices                0x33bf004c 0x33be7000 + 36940
30  UIKit                           0x2fe87a2c 0x2fe19000 + 453164
31  Xpress                          0x00154c54 0xa6000 + 715860
32  libdyld.dylib                   0x3a8e2aac 0x3a8e1000 + 6828

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x3a9942c8 0x3a993000 + 4808
1   libdispatch.dylib               0x3a8b6ec4 0x3a8a5000 + 73412
2   libdispatch.dylib               0x3a8b6bf6 0x3a8a5000 + 72694

Thread 2:
0   libsystem_kernel.dylib          0x3a9a89cc 0x3a993000 + 88524
1   libsystem_pthread.dylib         0x3aa24e9c 0x3aa24000 + 3740
2   libsystem_pthread.dylib         0x3aa24b74 0x3aa24000 + 2932

Thread 3:
0   libsystem_kernel.dylib          0x3a9a89cc 0x3a993000 + 88524
1   libsystem_pthread.dylib         0x3aa24e9c 0x3aa24000 + 3740
2   libsystem_pthread.dylib         0x3aa24b74 0x3aa24000 + 2932

Thread 4:
0   libsystem_kernel.dylib          0x3a9a89cc 0x3a993000 + 88524
1   libsystem_pthread.dylib         0x3aa24e9c 0x3aa24000 + 3740
2   libsystem_pthread.dylib         0x3aa24b74 0x3aa24000 + 2932

Pls help. 请帮助。 I am using UIImagePickerController to pick image from gallery. 我正在使用UIImagePickerController从图库中选择图像。 I worked fine on all iPhone . 我在所有iPhone上都能正常工作。 But its crashing in iPad iOS 8.0.2. 但它在iPad iOS 8.0.2中崩溃。 Image picker controller is displayed. 显示图像选择器控制器。 (All photos and Recently Added) options are shown. 显示(所有照片和最近添加的)选项。 But when I click on any one of the above, app crashes.. This happens only in iPad iOS 8.0.2. 但是,当我单击以上任意一项时,应用程序将崩溃。仅在iPad iOS 8.0.2中会发生这种情况。

On iPad , the correct way to present an image picker is to use a popover . iPadpresent image picker的正确方法是使用popover Check official document . 检查正式文件 Also check example 还要检查例子

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    //Present in Popover
} 
else 
{
    self presentViewController:imagePickerController animated:YES completion:nil];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序在iPad上的iOS 5中崩溃,并且在iOS 6和iOS 7中正常运行 - App crashes in iOS 5 in iPad and works fine in iOS 6 and iOS 7 Codename One应用程序适用于模拟器和Android,但在iPad和iphone上崩溃 - Codename One application works on simulator and Android but crashes on iPad and iphones UICollectionView布局在iPad上崩溃,但在iPhone上运行良好 - UICollectionView layout crashes on iPad, but works fine on iPhone 从相机获取照片时,imagePickerController崩溃。 从图片库工作正常。 为什么? - imagePickerController crashes when fetching photos from camera. From photo library works fine. Why? 从库中获取照片但从相机中获取照片时为什么imagePickerController崩溃 - Why imagePickerController crashes when fetching photo from library but from camera works fine 应用程序在iPad 2上工作正常,在iPad 3上崩溃,内存警告低 - app works fine on iPad 2, crashes on iPad 3, with low memory warning 应用程序在iOS 5中崩溃,在iOS 6和7中运行良好 - App crashes in iOS 5 and works fine in iOS 6 and 7 IOS 6中的AudioQueueDispose崩溃在IOS 5中正常运行 - AudioQueueDispose crashes in IOS 6, works fine in IOS 5 iOS 应用程序在手机上崩溃,但在模拟器上运行良好 - iOS App Crashes on Phone but works fine on simulator Google 登录在 IOS 上崩溃,但在 Android 上工作正常 - Google sign in crashes on IOS but works fine on Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM