开发者

Getting SIGABRT for a reason unknown to me

I am developing an iOS application (http://affogato.visioa.com/) that implements a tab bar controller, navigation controller and a tableview controller and each time I run my application, I get: "Thread 1: Program recieved signal: "SIGABRT". Could anyone shed any light as to why I am getting this and how to correct it?

Below is the console:

2011-08-28 13:13:57.070 Affogato[16469:b303] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "CoffeesView" nib but didn't get a UITableView.'
*** Call stack at first throw:
(
0   CoreFoundation                      0x00dc95a9 __exceptionPreprocess + 185
1   libobjc.A.dylib                     0x00f1d313 objc_exception_throw + 44
2   CoreFoundation                      0x00d81ef8 +[NSException raise:format:arguments:] + 136
3   CoreFoundation                      0x00d81e6a +[NSException raise:format:] + 58
4   UIKit                               0x00224e9b -[UITableViewController loadView] + 275
5   UIKit                               0x000cb00e -[UIViewController view] + 56
6   UIKit                               0x000c9482 -[UIViewController contentScrollView] + 42
7   UIKit                               0x000d9f25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
8   UIKit                               0x000d8555 -[UINavigationController _layoutViewController:] + 43
9   UIKit                               0x000d9870 -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
10  UIKit                               0x000d432a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
11  UIKit                               0x001ef2e9 -[UILayoutContainerView layoutSubviews] + 226
12  QuartzCore                          0x016b3a5a -[CALayer layoutSublayers] + 181
13  QuartzCore                          0x016b5ddc CALayerLayoutIfNeeded + 220
14  QuartzCore                          0x0165b0b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
15  QuartzCore                          0x0165c294 _ZN2CA11Transaction6commitEv + 292
16  UIKit                               0x0001d9c9 -[UIApplication _reportAppLaunchFinished] + 39
17  UIKit                               0x0001de83 -[UIApplication _runWithURL:payload:launc开发者_JS百科hOrientation:statusBarStyle:statusBarHidden:] + 690
18  UIKit                               0x00028617 -[UIApplication handleEvent:withNewEvent:] + 1533
19  UIKit                               0x00020abf -[UIApplication sendEvent:] + 71
20  UIKit                               0x00025f2e _UIApplicationHandleEvent + 7576
21  GraphicsServices                    0x01002992 PurpleEventCallback + 1550
22  CoreFoundation                      0x00daa944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
23  CoreFoundation                      0x00d0acf7 __CFRunLoopDoSource1 + 215
24  CoreFoundation                      0x00d07f83 __CFRunLoopRun + 979
25  CoreFoundation                      0x00d07840 CFRunLoopRunSpecific + 208
26  CoreFoundation                      0x00d07761 CFRunLoopRunInMode + 97
27  UIKit                               0x0001d7d2 -[UIApplication _run] + 623
28  UIKit                               0x00029c93 UIApplicationMain + 1160
29  Affogato                            0x00001ed9 main + 121
30  Affogato                            0x00001e55 start + 53
31  ???                                 0x00000001 0x0 + 1
)
terminate called throwing an exception


The first line of your console log gives the reason for the SIGABRT:

2011-08-28 13:13:57.070 Affogato[16469:b303] *** Terminating app 
due to uncaught exception 'NSInternalInconsistencyException', 
reason: '-[UITableViewController loadView] 
loaded the "CoffeesView" nib but didn't get a UITableView.'

If you intended to use a UITableViewController, it is looking in the NIB file for a UITableView to control - is there one there?

On the other hand, if you didn't mean to use this kind of controller, just change it to a UIViewController in the .h file.


I was getting the same error message and in my case the "view" outlet of table view was not connected in the storyboard scene. Control drag from ViewController object to the UITableView object embedded in the scene. HTH.


I had a same problem with the storyboard. the solution was very simple, In the storyboard, i was using the UIViewController class for my viewcontroller scene which should be actually UITableViewController. I just deleted my UIViewController scene and created new UITableViewController scene, the error went away.

I am pretty sure the same problem you have if you are using storyboard. If you are not using storyboard then make sure the class name you are setting in the XIB should be UITableViewController or Your custom class must inherit the UITableViewController in .h file and also make sure your view outlet set to your controller.


This error can also happen if you are using storyboards.

If you start a project as a universal app using storyboard then later change the project to support only in phone when you run the app on a iPad you may see this error.

To fix it temporally change the project back to universal and set the iPad storyboard to use the iPhone one, then set you project back to iPhone.

just an FYI


I think you should change:

[coffeeTypesArray objectAtIndex:row]

to

[coffeeTypesArray objectAtIndex:indexPath.row]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜