UIImageWriteToSavedPhotosAlbum崩溃堆栈跟踪/错误日志:什么是崩溃?

时间:2011-12-17 16:17:08

标签: iphone uiimagepickercontroller crash-reports

有人能告诉我这是什么类型的崩溃吗? (即内存不足?)

我收到了这个崩溃日志,但我不知道问题是什么。 我可以将代码包装在try catch块中,至少可以优雅地处理它。 我没有来自用户的任何步骤,我无法在此代码中让我的iOS设备崩溃。

Thread 0 name:  Dispatch queue: com.apple.assetsd.sharedPersistentStoreCoordinator
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x3339f32c __pthread_kill + 8
1   libsystem_c.dylib               0x376e7f54 pthread_kill
2   libsystem_c.dylib               0x376e0fe4 abort
3   libc++abi.dylib                 0x33384f64 abort_message + 40
4   libc++abi.dylib                 0x33382346 _ZL17default_terminatev + 18
5   libobjc.A.dylib                 0x332b72dc _objc_terminate
6   libc++abi.dylib                 0x333823be _ZL19safe_handler_callerPFvvE + 70
7   libc++abi.dylib                 0x33382372 __cxxabiv1::__terminate(void (*)()) + 2
8   libc++abi.dylib                 0x33382882 __cxa_call_terminate + 46
9   libc++abi.dylib                 0x333832ac __gxx_personality_sj0 + 968
10  libunwind.dylib                 0x33170a7e unwind_phase2 + 66
11  libunwind.dylib                 0x33170c0e _Unwind_SjLj_Resume + 122
12  PhotoLibraryServices            0x324d99ea -[PLPhotoLibrary(Protected) loadDatabase]
13  PhotoLibraryServices            0x324a217e -[PLPhotoLibrary initWithPath:canTriggerDatabaseUpdate:]
14  PhotoLibraryServices            0x324e919e __42+[PLSharedPhotoLibrary sharedPhotoLibrary]_block_invoke_0
15  libdispatch.dylib               0x347c5570 dispatch_once_f$VARIANT$up
16  PhotoLibraryServices            0x324e915c +[PLSharedPhotoLibrary sharedPhotoLibrary]
17  PhotoLibraryServices            0x324aa068 __withSavedPhotosAlbumUUID_block_invoke_0
18  libdispatch.dylib               0x347c5570 dispatch_once_f$VARIANT$up
19  PhotoLibraryServices            0x324a9430 withSavedPhotosAlbumUUID
20  PhotoLibraryServices            0x324a9372 PLSaveImageToCameraRoll
21  UIKit                           0x30b9f1ce UIImageWriteToSavedPhotosAlbum

以下是代码:

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

NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
UIImage *originalImage, *editedImage, *imageToSave;

// Handle a still image capture
if (CFStringCompare ((CFStringRef) mediaType, kUTTypeImage, 0)
    == kCFCompareEqualTo) {

    editedImage = (UIImage *) [info objectForKey:
                               UIImagePickerControllerEditedImage];
    originalImage = (UIImage *) [info objectForKey:
                                 UIImagePickerControllerOriginalImage];

    if (editedImage) {
        imageToSave = editedImage;
    } else {
        imageToSave = originalImage;
    }

    if (imagePickerSourceType == UIImagePickerControllerSourceTypeCamera) {
        // Save the new image (original or edited) to the Camera Roll
        UIImageWriteToSavedPhotosAlbum (imageToSave, nil, nil , nil);
    }

}

UIImageWriteToSavedPhotosAlbum(imageToSave,nil,nil,nil);

我不能让它在我的设备上崩溃,否则我将有更好的机会解决这个问题。这是iTunes Connect的崩溃日志。

0 个答案:

没有答案