Getting SIGABRT for a reason unknown to me - iphone

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:launchOrientation: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]

Related

Xcode "-[UIViewController _loadViewFromNibNamed:bundle:] loaded the nib but the view outlet was not set." error

I'm using Xcode 4 and when I run my app, the first screen doesn't load. It fails in the simulators and on a device. I've searched for answers and they all say to make sure I've dragged the circles in Files Owner to the correct views. Sorry I don't remember the names of the things, I'm new to Xcode. I've dragged the circles to the correct view and tried many things but none of them worked. What could I be doing wrong?
Here is the full error:
2012-02-19 12:59:54.655 Ponyboard[271:207]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "PonyboardViewController" nib but the view outlet was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00f095a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0105d313 objc_exception_throw + 44
2 CoreFoundation 0x00ec1ef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00ec1e6a +[NSException raise:format:] + 58
4 UIKit 0x0020d709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x0020b134 -[UIViewController loadView] + 120
6 UIKit 0x0020b00e -[UIViewController view] + 56
7 UIKit 0x0017ed42 -[UIWindow addRootViewControllerViewIfPossible] + 51
8 Ponyboard 0x00002a87 -[PonyboardAppDelegate application:didFinishLaunchingWithOptions:] + 135
9 UIKit 0x0015bc89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
10 UIKit 0x0015dd88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
11 UIKit 0x00168617 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x00160abf -[UIApplication sendEvent:] + 71
13 UIKit 0x00165f2e _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x031fd992 PurpleEventCallback + 1550
15 CoreFoundation 0x00eea944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00e4acf7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00e47f83 __CFRunLoopRun + 979
18 CoreFoundation 0x00e47840 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00e47761 CFRunLoopRunInMode + 97
20 UIKit 0x0015d7d2 -[UIApplication _run] + 623
21 UIKit 0x00169c93 UIApplicationMain + 1160
22 Ponyboard 0x000029c9 main + 121
23 Ponyboard 0x00002945 start + 53
)
terminate called after throwing an instance of 'NSException'
Are you sure you have a UIView (or subclass) assigned to the "view" property of PonyboardViewController? Right click on "File Owner" in the left pane of the xib for PonyboardViewController and verify that the "view" outlet is set.
If not, set it to a view!
I just have the same problem as you, so I fixed it like that:
this is my code block:
self.chatsView = [[ChatsView alloc] initWithNibName:#"ChatsView" bundle:nil];
I click ChatsView.xib to find the "File's owner", then hover my mouse over the "File's owner", and right click, that will prompt something like this:
The unconnected 'view' outlet
you must drag the "view" Outlet to connect to the View which have two subViews: Search Bar&Table View in my xib file.
The connected 'view' outlet
Your problem probably lies with the XIB or Stroyborad scene. Check whether the View is connected properly to the class.
I've tried, and it works fine for me after doing it.

tableView in xib not picking up datasource delegate methods in associated view controller

My main xib file has a tab bar controller and each tab is linked to a different xib.
One of the tabs is a nav controller and its view controller is linked to a xib as per this answer.
When I run the app I get the below error. its as if its not even looking in the view controller for these methods.
i have tried everything including using a different xib, checking the links in interface builder i.e. the tableview's delegate and datasource. i have implemented the required protocol methods in the vc e.g. numberofrowsinsection.
as soon as i remove the datasource link in the xib the error goes away.
EDIT: When I add this view controller's view to the main window (just to test) the tableview loads without issues. So it seems it only happens when I use it as part of the nav controller and tab controller.
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[UIViewController
tableView:numberOfRowsInSection:]: unrecognized selector sent to
instance 0x6120ae0'
* Call stack at first throw: ( 0 CoreFoundation
0x00dc45a9 exceptionPreprocess + 185 1 libobjc.A.dylib
0x00f18313 objc_exception_throw + 44 2 CoreFoundation
0x00dc60bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3
CoreFoundation 0x00d35966 __forwarding + 966
4 CoreFoundation 0x00d35522
_CF_forwarding_prep_0 + 50 5 UIKit
0x001d32b7 -[UISectionRowData
refreshWithSection:tableView:tableViewRowData:] + 1834 6 UIKit
0x001d0d88 -[UITableViewRowData numberOfRows] + 108 7 UIKit
0x00084677 -[UITableView noteNumberOfRowsChanged] + 132 8 UIKit
0x00091708 -[UITableView reloadData] + 773 9 UIKit
0x0008e844 -[UITableView layoutSubviews] + 42 10 QuartzCore
0x016aea5a -[CALayer layoutSublayers] + 181 11 QuartzCore
0x016b0ddc CALayerLayoutIfNeeded + 220 12 QuartzCore
0x016560b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
13 QuartzCore 0x01657294
_ZN2CA11Transaction6commitEv + 292 14 QuartzCore
0x0165746d
_ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
15 CoreFoundation 0x00da589b
CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 27 16
CoreFoundation 0x00d3a6e7 __CFRunLoopDoObservers
+ 295 17 CoreFoundation 0x00d031d7
__CFRunLoopRun + 1575 18 CoreFoundation
0x00d02840 CFRunLoopRunSpecific + 208 19 CoreFoundation
0x00d02761 CFRunLoopRunInMode + 97 20 GraphicsServices
0x00ffc1c4 GSEventRunModal + 217 21 GraphicsServices
0x00ffc289 GSEventRun + 115 22 UIKit
0x00024c93 UIApplicationMain + 1160 23 MyPractice
0x00002339 main + 121 24 MyPractice
0x000022b5 start + 53 ) terminate called after throwing an instance of
'NSException'
This log message:
[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance
Implies that the UITableView dataSource method is being sent to an instance of UIViewController, not an instance of your subclass. How are you initialising your VC? If you're initialising it from within a XIB, have you correctly set the VC's class to your subclass?

Universal app crashes on iPad simulator at each alternate time

My app crashes on iPad simulator in alternate builds, crash then run then crash, etc.
objc[1116]: Class Protocol is implemented in both /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libobjc.A.dylib and /Users/NGA24iMAC3/Library/Application Support/iPhone Simulator/4.2/Applications/C0FFA7D7-7684-4854-B641-62BD11CFD226/Innovations.app/Innovations. One of the two will be used. Which one is undefined.
2011-02-09 11:53:01.446 Innovations[1116:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "PadLoginScreen" nib but the view outlet was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x01286be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x013db5c2 objc_exception_throw + 47
2 CoreFoundation 0x0123f628 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x0123f59a +[NSException raise:format:] + 58
4 UIKit 0x004a2b75 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x004a0709 -[UIViewController loadView] + 120
6 UIKit 0x004a05e3 -[UIViewController view] + 56
7 UIKit 0x0049ea57 -[UIViewController contentScrollView] + 42
8 UIKit 0x004af201 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
9 UIKit 0x004ad831 -[UINavigationController _layoutViewController:] + 43
10 UIKit 0x004aeb4c -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
11 UIKit 0x004a9606 -[UINavigationController _startDeferredTransitionIfNeeded] + 266
12 UIKit 0x004b083e -[UINavigationController pushViewController:transition:forceImmediate:] + 932
13 UIKit 0x004a94a0 -[UINavigationController pushViewController:animated:] + 62
14 Innovations 0x00006172 -[SplashScreenController switchView] + 303
15 Foundation 0x001887a5 __NSFireTimer + 125
16 CoreFoundation 0x01267fe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
17 CoreFoundation 0x01269594 __CFRunLoopDoTimer + 1220
18 CoreFoundation 0x011c5cc9 __CFRunLoopRun + 1817
19 CoreFoundation 0x011c5240 CFRunLoopRunSpecific + 208
20 CoreFoundation 0x011c5161 CFRunLoopRunInMode + 97
21 GraphicsServices 0x01b52268 GSEventRunModal + 217
22 GraphicsServices 0x01b5232d GSEventRun + 115
23 UIKit 0x0040142e UIApplicationMain + 1160
24 Innovations 0x00002e70 main + 102
25 Innovations 0x00002e01 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
But all outlet set correctly in IB.Please help me.Thanx in advance.
#Ishu i think that something is wrong with your connections in IB.I know you checked your IB but can you make your .xib file once again.
I suggest cleaning your project. Command + Shift + K
Next, open your XIB file and verify that the view outlet of the "File's Owner" is connected to your view. Of not connect and it and save.
Rebuild your project.
I also faced same problem in my Universal app .
I did something like this that solved my problem -
- (id)initWithNibName:(NSString *)n bundle:(NSBundle *)b
{
return [self init];
}
- (id)init
{
BOOL iPad = NO;
#ifdef UI_USER_INTERFACE_IDIOM
iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#endif
if (iPad)
{
// iPad specific code here
NSLog(#"Device is iPad");
[super initWithNibName:#"ContactUsViewController~ipad" bundle:nil];
} else
{
// iPhone/iPod specific code here
NSLog(#"Device is iPhone");
[super initWithNibName:#"ContactUsViewController" bundle:nil];
}
return self;
}
when you are adding/pushing viewController just call its init method and then push viewcontroller.
Open our iPad xib in Interface Builder
Click on File's ownner
In the Inspector, go to the fourth tab (Identity)
Write as class identity the name of the class that is acting as view controller for that xib.
Ready to go!

app crashes after xib edit

I have a navigation controller app. I created a RootViewController class with Xib file. In that xib file I had table view and nothing more else. Toolbar and buttons on the toolbar I created in program way. Table view had datasourse and delegate File Owner.
I deleted this xib file, and created a new one with previous name. Created it like viewBased xib file and then I dropped down to it table view, toolbar, two buttons on toolbar. Add outlets on them. Saved it all. Clear all targets. Build all. And Run. Application crashes on start! Anyone know where may be the problem? Thanx!
Stack:
[Session started at 2010-11-16 15:00:52 +0200.]
2010-11-16 15:00:53.729 PhoneBook[16210:207] ******* Accessibility Status Changed: On
2010-11-16 15:00:53.755 PhoneBook[16210:207] ********** Loading AX for: com.yourcompany.PhoneBook ************
2010-11-16 15:00:53.798 PhoneBook[16210:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the view outlet was not set.'
*** Call stack at first throw:
(
0 CoreFoundation 0x02510b99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0266040e objc_exception_throw + 47
2 CoreFoundation 0x024c9238 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x024c91aa +[NSException raise:format:] + 58
4 UIKit 0x0036aa40 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
5 UIKit 0x00368675 -[UIViewController loadView] + 120
6 UIKit 0x004c1c8c -[UITableViewController loadView] + 80
7 UIKit 0x0036854f -[UIViewController view] + 56
8 UIKit 0x003669f4 -[UIViewController contentScrollView] + 42
9 UIKit 0x003767e2 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
10 UIKit 0x00374ea3 -[UINavigationController _layoutViewController:] + 43
11 UIKit 0x0037612d -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
12 UIKit 0x00370ccd -[UINavigationController _startDeferredTransitionIfNeeded] + 266
13 UIKit 0x0048db55 -[UILayoutContainerView layoutSubviews] + 226
14 QuartzCore 0x0456a481 -[CALayer layoutSublayers] + 177
15 QuartzCore 0x0456a1b1 CALayerLayoutIfNeeded + 220
16 QuartzCore 0x045632e0 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 302
17 QuartzCore 0x04563040 _ZN2CA11Transaction6commitEv + 292
18 UIKit 0x002c104e -[UIApplication _reportAppLaunchFinished] + 39
19 UIKit 0x002c1477 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 545
20 UIKit 0x002cb3ec -[UIApplication handleEvent:withNewEvent:] + 1958
21 UIKit 0x002c3b3c -[UIApplication sendEvent:] + 71
22 UIKit 0x002c89bf _UIApplicationHandleEvent + 7672
23 GraphicsServices 0x02d6c822 PurpleEventCallback + 1550
24 CoreFoundation 0x024f1ff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
25 CoreFoundation 0x02452807 __CFRunLoopDoSource1 + 215
26 CoreFoundation 0x0244fa93 __CFRunLoopRun + 979
27 CoreFoundation 0x0244f350 CFRunLoopRunSpecific + 208
28 CoreFoundation 0x0244f271 CFRunLoopRunInMode + 97
29 UIKit 0x002c0c6d -[UIApplication _run] + 625
30 UIKit 0x002ccaf2 UIApplicationMain + 1160
31 PhoneBook 0x00002494 main + 102
32 PhoneBook 0x00002425 start + 53
)
terminate called after throwing an instance of 'NSException'
* Terminating app due to uncaught exception
'NSInternalInconsistencyException',
reason: '-[UIViewController
_loadViewFromNibNamed:bundle:] loaded the "RootViewController" nib but the
view outlet was not set.'
Your view controller lost connection for view outlet, you need to restore it in IB (as you do with all outlets)

iPhone app crashes on startup

I had two apps in xcode, which i wanted to combine, so i started a new project and attempted to put the two apps together in this new one. Was this a really stupid thing to do?
The app now crashes on start up and i have no idea why, i'm 99% the outlets are all connected. It uses xcdatamodel for storage and i've imported the right framework.
Can anyone think of any other things that could be going wrong?
I can attach a zip file with the project in if someone wouldn't mind having a look
Any help is massively appreciated!
Thanks
This is the stack trace:
2010-11-02 08:18:59.903 iStalker[34745:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x5b10e20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key textField.'
*** Call stack at first throw:
(
0 CoreFoundation 0x0256f919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x026bd5de objc_exception_throw + 47
2 CoreFoundation 0x0256f851 -[NSException raise] + 17
3 Foundation 0x0003bc2b _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003bb99 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004b5d0a -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x024e5b6f -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004b4721 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004b64b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002c59bb -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002c690d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
11 UIKit 0x002d0452 -[UIApplication handleEvent:withNewEvent:] + 1958
12 UIKit 0x002c9074 -[UIApplication sendEvent:] + 71
13 UIKit 0x002cdac4 _UIApplicationHandleEvent + 7495
14 GraphicsServices 0x02dd5afa PurpleEventCallback + 1578
15 CoreFoundation 0x02550dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x024b1737 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x024ae9c3 __CFRunLoopRun + 979
18 CoreFoundation 0x024ae280 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x024ae1a1 CFRunLoopRunInMode + 97
20 UIKit 0x002c6226 -[UIApplication _run] + 625
21 UIKit 0x002d1b58 UIApplicationMain + 1160
22 iStalker 0x00001b50 main + 102
23 iStalker 0x00001ae1 start + 53
)
terminate called after throwing an instance of 'NSException'
Looks like you have a text field connected to the application delegate in your main XIB. There is no such field defined on the real application delegate, which is why you’re getting the error.
Thats because you set main xib for app in info plist and set File Owner to appDelegate, while main xib file's owner is always UIApplication. Possible solution - add Object to .xib, set its class for appDelegate class and connect all unnecessary outlets. This worked for me.