1

I recently upgraded an app I created from iOS 6 to iOS 7 (and Xcode 4 to Xcode 5). I then tried to run the app, and the build said it succeeded, however the app crashed and directed me to this code and the error message:

int retVal = UIApplicationMain(argc, argv, nil, nil);

Thread 1 signal:SIGABRT

The console log is below in case that helps:

2014-01-14 14:30:39.791 Recipes[1808:70b] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UIImageView: 0x8ba3e80; frame = (0 0; 320 568); autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x8ba3f10>> is associated with <UIViewController: 0x8b93c60>. Clear this association before associating this view with <UIViewController: 0x8b95690>.'
*** First throw call stack:
(
    0   CoreFoundation                      0x01ab45e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x018378b6 objc_exception_throw + 44
    2   CoreFoundation                      0x01ab43bb +[NSException raise:format:] + 139
    3   UIKit                               0x00a31c99 -[UIView(Internal) _setViewDelegate:] + 242
    4   UIKit                               0x00ae3ecc +[UIViewController setViewController:forView:] + 40
    5   UIKit                               0x00ade921 -[UIViewController setView:] + 511
    6   Foundation                          0x005e6d28 _NSSetUsingKeyValueSetter + 133
    7   Foundation                          0x005e6253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
    8   Foundation                          0x0064870a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
    9   UIKit                               0x00c6ca15 -[UIRuntimeOutletConnection connect] + 106
    10  libobjc.A.dylib                     0x018497d2 -[NSObject performSelector:] + 62
    11  CoreFoundation                      0x01aafb6a -[NSArray makeObjectsPerformSelector:] + 314
    12  UIKit                               0x00c6b56e -[UINib instantiateWithOwner:options:] + 1417
    13  UIKit                               0x00c6d2fb -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 165
    14  UIKit                               0x009ca3bb -[UIApplication _loadMainNibFileNamed:bundle:] + 58
    15  UIKit                               0x009ca6e9 -[UIApplication _loadMainInterfaceFile] + 245
    16  UIKit                               0x009c928f -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 543
    17  UIKit                               0x009dd87c -[UIApplication handleEvent:withNewEvent:] + 3447
    18  UIKit                               0x009ddde9 -[UIApplication sendEvent:] + 85
    19  UIKit                               0x009cb025 _UIApplicationHandleEvent + 736
    20  GraphicsServices                    0x02ea62f6 _PurpleEventCallback + 776
    21  GraphicsServices                    0x02ea5e01 PurpleEventCallback + 46
    22  CoreFoundation                      0x01a2fd65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    23  CoreFoundation                      0x01a2fa9b __CFRunLoopDoSource1 + 523
    24  CoreFoundation                      0x01a5a77c __CFRunLoopRun + 2156
    25  CoreFoundation                      0x01a59ac3 CFRunLoopRunSpecific + 467
    26  CoreFoundation                      0x01a598db CFRunLoopRunInMode + 123
    27  UIKit                               0x009c8add -[UIApplication _run] + 840
    28  UIKit                               0x009cad3b UIApplicationMain + 1225
    29  Recipes                             0x000022cf main + 93
    30  libdyld.dylib                       0x02b4670d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Any help is greatly appreciated. Thanks!

2
  • 5
    The first line is telling you exactly what the issue is. And without any code, it's not possible to provide you with more assistance than that. Jan 14, 2014 at 19:39
  • You're adding a UIImageView to two different viewControllers at the same time. It mentions which one and which viewControllers on the first line. Jan 14, 2014 at 20:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.