0

我正在将 Aviary 集成到我的应用程序中,当我尝试呈现AFPhotoEditorController到我的一个视图控制器时出现崩溃。

   static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        [self setPhotoEditorCustomizationOptions];
    });

    // Initialize the photo editor and set its delegate

    AFPhotoEditorController * photoEditor = [[AFPhotoEditorController alloc] initWithImage:editingResImage];
    [photoEditor setDelegate:self];

    // If a high res image is passed, create the high res context with the image and the photo editor.
        if (highResImage) {
            [self setupHighResContextForPhotoEditor:photoEditor withImage:highResImage];
        }

    // Present the photo editor.
    //This is the line on which i am getting crash
    [self presentViewController:photoEditor animated:YES completion:nil]; 

这是实际的堆栈跟踪

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/Mac/Library/Application Support/iPhone Simulator/7.0/Applications/CB39553D-8CA9-425C-BF5E-B33DD5813CA9/KidstaGram.app/AviarySDKResources.bundle> (not yet loaded)' with name 'AFSDKViewController_iPhone_4_inch_7''

 First throw call stack:
(
    0   CoreFoundation                      0x027055e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x024888b6 objc_exception_throw + 44
    2   CoreFoundation                      0x027053bb +[NSException raise:format:] + 139
    3   UIKit                               0x0149b65c -[UINib instantiateWithOwner:options:] + 951
    4   UIKit                               0x0130dc95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
    5   UIKit                               0x0130e43d -[UIViewController loadView] + 302
    6   UIKit                               0x0130e73e -[UIViewController loadViewIfRequired] + 78
    7   UIKit                               0x0130ec44 -[UIViewController view] + 35
    8   UIKit                               0x0131d9f1 -[UIViewController viewControllerForRotation] + 63
    9   UIKit                               0x01315590 -[UIViewController _visibleView] + 84
    10  UIKit                               0x015a321a -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:animation:] + 5199
    11  UIKit                               0x0131a78c -[UIViewController presentViewController:withTransition:completion:] + 6433
    12  UIKit                               0x0fcb9f1f -[UIViewControllerAccessibility(SafeCategory) presentViewController:withTransition:completion:] + 71
    13  UIKit                               0x0131acaf -[UIViewController presentViewController:animated:completion:] + 130
    14  KidstaGram                          0x00029f9c -[UploadViewController launchPhotoEditorWithImage:highResolutionImage:] + 412
    15  KidstaGram                          0x00029d0f -[UploadViewController launchEditorWithAsset:] + 191
    16  KidstaGram                          0x0002b3fb __76-[UploadViewController imagePickerController:didFinishPickingMediaWithInfo:]_block_invoke_2 + 107
    17  AssetsLibrary                       0x0077f639 __56-[ALAssetsLibrary assetForURL:resultBlock:failureBlock:]_block_invoke_2 + 215
    18  libdispatch.dylib                   0x068f0818 _dispatch_call_block_and_release + 15
    19  libdispatch.dylib                   0x069054b0 _dispatch_client_callout + 14
    20  libdispatch.dylib                   0x068f3766 _dispatch_main_queue_callback_4CF + 340
    21  CoreFoundation                      0x0276aa5e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
    22  CoreFoundation                      0x026ab72b __CFRunLoopRun + 1963
    23  CoreFoundation                      0x026aab33 CFRunLoopRunSpecific + 467
    24  CoreFoundation                      0x026aa94b CFRunLoopRunInMode + 123
    25  GraphicsServices                    0x037069d7 GSEventRunModal + 192
    26  GraphicsServices                    0x037067fe GSEventRun + 104
    27  UIKit                               0x011fb94b UIApplicationMain + 1225
    28  KidstaGram                          0x00015fbd main + 141
    29  libdyld.dylib                       0x06b95725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
4

2 回答 2

2

请在 Aviary 网站: developers.aviary.com上更新到最新版本的 SDK 。此外,还请确保您更新了 .framework 文件和 .bundle 文件

于 2014-11-03T21:10:06.600 回答
0

如果您使用 Adob​​eCreativeSDK,它将对您有所帮助。首先,我们需要打开 Adob​​eCreativeSDKImage.framework 并从中转到资源文件夹并复制 Adob​​eCreativeSDKImageResources.bundle 并将其粘贴到项目目录中,然后将其添加到项目中

以同样的方式,首先我们需要打开 Adob​​eCreativeSDKFoundation.framework 并从中转到资源文件夹并复制 Adob​​eCreativeSDKFoundationResources.bundle 并将其粘贴到项目目录中,然后将其添加到项目中

于 2015-07-04T11:07:22.023 回答