我将Aviary集成到我的应用程序中,当尝试将AFPhotoEditorController
呈现到我的View Controller之一时崩溃。
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
最佳答案
请在Aviary网站上更新到最新版本的SDK:developers.aviary.com。此外,请确保除了.bundle之外,还更新了.framework文件