UIWebView throwing NSUnknownKeyException iPad - ipad

I have a tab bar application. Everything works normally, and I can switch between tabs fine and everything, except when I switch to my second tab ProductViewClass the view doesn't update and it spits out the console output below. I have nothing in this view except for a UIWebView and a UILabel. When I delete the UIWebView it runs successfully, and when I add another it still works. It only stops working when I connect the IBOutlet from my File's Owner to the UIWebView. Besides synthesizing and releasing productWebView the only non-template code in ProductWebView.m is this:
NSString *urlString = #"http://www.google.com/";
NSURL *theURL = [NSURL URLWithString:urlString];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:theURL];
[productWebView loadRequest:urlRequest];
NSLog(#"Google loaded");
The entirety of ProductWebView.h is as follows:
#import <UIKit/UIKit.h>
#interface ProductViewClass : UIViewController {
IBOutlet UIWebView *productWebView;
}
#property(nonatomic, retain) UIWebView *productWebView;
#end
Here's the console output:
This GDB was configured as "x86_64-apple-darwin".Attaching to process 52523.
2011-01-30 19:18:28.907 FairCom[52523:40b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x4d06eb0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key productWebView.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00da8be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00efd5c2 objc_exception_throw + 47
2 CoreFoundation 0x00da8b21 -[NSException raise] + 17
3 Foundation 0x000296cf _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0002963d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004a88d6 -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d1f2cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004a72ed -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004a9081 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x00361a94 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x0035f709 -[UIViewController loadView] + 120
11 UIKit 0x0035f5e3 -[UIViewController view] + 56
12 UIKit 0x00372230 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 120
13 UIKit 0x00370d86 -[UITabBarController transitionFromViewController:toViewController:] + 64
14 UIKit 0x00372b7e -[UITabBarController _setSelectedViewController:] + 263
15 UIKit 0x003729ed -[UITabBarController _tabBarItemClicked:] + 352
16 UIKit 0x002b1a6e -[UIApplication sendAction:to:from:forEvent:] + 119
17 UIKit 0x004af1f2 -[UITabBar _sendAction:withEvent:] + 422
18 UIKit 0x002b1a6e -[UIApplication sendAction:to:from:forEvent:] + 119
19 UIKit 0x003401b5 -[UIControl sendAction:to:forEvent:] + 67
20 UIKit 0x00342647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
21 UIKit 0x0034016c -[UIControl sendActionsForControlEvents:] + 49
22 UIKit 0x002b1a6e -[UIApplication sendAction:to:from:forEvent:] + 119
23 UIKit 0x003401b5 -[UIControl sendAction:to:forEvent:] + 67
24 UIKit 0x00342647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
25 UIKit 0x003411f4 -[UIControl touchesEnded:withEvent:] + 458
26 UIKit 0x002d60d1 -[UIWindow _sendTouchesForEvent:] + 567
27 UIKit 0x002b737a -[UIApplication sendEvent:] + 447
28 UIKit 0x002bc732 _UIApplicationHandleEvent + 7576
29 GraphicsServices 0x016dea36 PurpleEventCallback + 1550
30 CoreFoundation 0x00d8a064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
31 CoreFoundation 0x00cea6f7 __CFRunLoopDoSource1 + 215
32 CoreFoundation 0x00ce7983 __CFRunLoopRun + 979
33 CoreFoundation 0x00ce7240 CFRunLoopRunSpecific + 208
34 CoreFoundation 0x00ce7161 CFRunLoopRunInMode + 97
35 GraphicsServices 0x016dd268 GSEventRunModal + 217
36 GraphicsServices 0x016dd32d GSEventRun + 115
37 UIKit 0x002c042e UIApplicationMain + 1160
38 FairCom 0x00001be0 main + 102
39 FairCom 0x00001b71 start + 53
40 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
sharedlibrary apply-load-rules all
(gdb)
Thanks for your help!

You're loading a nib. In that nib, you have an outlet named productWebView that's hooked up, presumably to a web view. The exception you're seeing is telling you that the outlet productWebView doesn't actually exist. Here's where it gets weird. The error says the object <UIViewController 0x4d06eb0> is the one that has this missing outlet. The weird bit is where it says UIViewController instead of the name of an actual view controller subclass. It sounds like you have a nib where the File's Owner is set up as one of your view controller subclasses, but at runtime you're actually just using an instance of UIViewController directly. You should verify that all the view controllers representing tabs in your tab bar controller are actual correct subclasses of UIViewController instead of just an instance of UIViewController itself.

Related

Iphone Simulator terminating opening a new Table ViewController

In my application I had a button and from there I opened a TableViewController and it worked perfectly fine.
And now I added another button and I linked the button to another TableViewController
Now when I am clicking this new button my application is crashing:
libc++abi.dylib: terminating with uncaught exception of type NSException
In other places in StackOverflow they mentioned about an unclosed IBOutlet but I have not created any outlet for the button itself, so what problem could that be.
Log :
*** First throw call stack:
(
0 CoreFoundation 0x000000010712f34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010677321e objc_exception_throw + 48
2 CoreFoundation 0x0000000107198265 +[NSException raise:format:] + 197
3 UIKit 0x000000010797383c -[UITableViewController loadView] + 638
4 UIKit 0x00000001076f3c4c -[UIViewController loadViewIfRequired] + 201
5 UIKit 0x00000001076f44a0 -[UIViewController view] + 27
6 UIKit 0x0000000107fb88d0 -[_UIFullscreenPresentationController _setPresentedViewController:] + 87
7 UIKit 0x00000001076ced26 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 141
8 UIKit 0x000000010770730b -[UIViewController _presentViewController:withAnimationController:completion:] + 3956
9 UIKit 0x000000010770a6df -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 530
10 UIKit 0x000000010770a1c5 -[UIViewController presentViewController:animated:completion:] + 179
11 UIKit 0x000000010770f892 -[UIViewController _showViewController:withAction:sender:] + 274
12 UIKit 0x0000000107bd41b6 __66-[UIStoryboardShowSegueTemplate newDefaultPerformHandlerForSegue:]_block_invoke + 134
13 UIKit 0x0000000107d2d40d -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 447
14 UIKit 0x0000000107d2d21d -[UIStoryboardSegueTemplate _perform:] + 82
15 UIKit 0x0000000107d2d4df -[UIStoryboardSegueTemplate perform:] + 156
16 UIKit 0x0000000107554b88 -[UIApplication sendAction:to:from:forEvent:] + 83
17 UIKit 0x00000001076da2b2 -[UIControl sendAction:to:forEvent:] + 67
18 UIKit 0x00000001076da5cb -[UIControl _sendActionsForEvents:withEvent:] + 444
19 UIKit 0x00000001076d94c7 -[UIControl touchesEnded:withEvent:] + 668
20 UIKit 0x00000001075c20d5 -[UIWindow _sendTouchesForEvent:] + 2747
21 UIKit 0x00000001075c37c3 -[UIWindow sendEvent:] + 4011
22 UIKit 0x0000000107570a33 -[UIApplication sendEvent:] + 371
23 UIKit 0x0000000107d62b6d __dispatchPreprocessedEventFromEventQueue + 3248
24 UIKit 0x0000000107d5b817 __handleEventQueue + 4879
25 CoreFoundation 0x00000001070d4311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
26 CoreFoundation 0x00000001070b959c __CFRunLoopDoSources0 + 556
27 CoreFoundation 0x00000001070b8a86 __CFRunLoopRun + 918
28 CoreFoundation 0x00000001070b8494 CFRunLoopRunSpecific + 420
29 GraphicsServices 0x0000000109ebaa6f GSEventRunModal + 161
30 UIKit 0x0000000107552f34 UIApplicationMain + 159
31 OneTest 0x0000000105bfbc3f main + 111
32 libdyld.dylib 0x0000000108eef68d start + 1
)
This is what I did, I removed that new TableViewcontroller. Then I added a new ViewController and linked this ViewController to my Button by making a Segue. To the same button and it worked by opening the new ViewController. Then as soon as I linked the new View controller to my class it stopped working. Any possible reason for that?

Xcode 6 Unknown class in Interface Builder file

The error comes when the button links to a view controller. I am desperate to fix this problem. I am also quite new to Xcode.
I have tried, but none of them worked:
Unknown class in Interface Builder file Xcode error
Xcode 6 Strange Bug: Unknown class in Interference Builder file
XCode Unknown class ***** in Interface Builder file
The error is:
2015-04-19 15:17:32.565 *****[*******] Unknown class ******* in Interface Builder file.
2015-04-19 15:17:32.671 *****[********] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7aecbd00> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ********.'
*** First throw call stack:
(
0 CoreFoundation 0x01ff7466 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x01c80a97 objc_exception_throw + 44
2 CoreFoundation 0x01ff7081 -[NSException raise] + 17
3 Foundation 0x0190380e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x0185f838 _NSSetUsingKeyValueSetter + 115
5 Foundation 0x0185f7bd -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x018950a6 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 386
7 UIKit 0x0097e329 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x01c96724 -[NSObject performSelector:] + 62
9 CoreFoundation 0x01f30dbc -[NSArray makeObjectsPerformSelector:] + 316
10 UIKit 0x0097cdea -[UINib instantiateWithOwner:options:] + 1775
11 UIKit 0x0079e2a4 -[UIViewController _loadViewFromNibNamed:bundle:] + 270
12 UIKit 0x0079ea3b -[UIViewController loadView] + 295
13 UIKit 0x0079ec6f -[UIViewController loadViewIfRequired] + 78
14 UIKit 0x0079f215 -[UIViewController view] + 35
15 UIKit 0x00e14ca7 -[_UIFullscreenPresentationController _setPresentedViewController:] + 75
16 UIKit 0x00774551 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 113
17 UIKit 0x007ac6e1 -[UIViewController _presentViewController:withAnimationController:completion:] + 2102
18 UIKit 0x007af252 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 345
19 UIKit 0x007af0a4 -[UIViewController presentViewController:animated:completion:] + 224
20 UIKit 0x007af56a -[UIViewController presentModalViewController:animated:] + 57
21 UIKit 0x00c786cd -[UIStoryboardModalSegue perform] + 271
22 UIKit 0x00c65d89 -[UIStoryboardSegueTemplate _perform:] + 217
23 UIKit 0x00c65e05 -[UIStoryboardSegueTemplate perform:] + 116
24 libobjc.A.dylib 0x01c967cd -[NSObject performSelector:withObject:withObject:] + 84
25 UIKit 0x00648340 -[UIApplication sendAction:to:from:forEvent:] + 99
26 UIKit 0x006482d2 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
27 UIKit 0x0077ca56 -[UIControl sendAction:to:forEvent:] + 69
28 UIKit 0x0077ce73 -[UIControl _sendActionsForEvents:withEvent:] + 598
29 UIKit 0x0077c0dd -[UIControl touchesEnded:withEvent:] + 660
30 UIKit 0x00698ffa -[UIWindow _sendTouchesForEvent:] + 874
31 UIKit 0x00699ad5 -[UIWindow sendEvent:] + 791
32 UIKit 0x0065ebb1 -[UIApplication sendEvent:] + 242
33 UIKit 0x0066ebf6 _UIApplicationHandleEventFromQueueEvent + 21066
34 UIKit 0x00642bc7 _UIApplicationHandleEventQueue + 2300
35 CoreFoundation 0x01f1a98f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
36 CoreFoundation 0x01f1049d __CFRunLoopDoSources0 + 253
37 CoreFoundation 0x01f0f9f8 __CFRunLoopRun + 952
38 CoreFoundation 0x01f0f37b CFRunLoopRunSpecific + 443
39 CoreFoundation 0x01f0f1ab CFRunLoopRunInMode + 123
40 GraphicsServices 0x039022c1 GSEventRunModal + 192
41 GraphicsServices 0x039020fe GSEventRun + 104
42 UIKit 0x006469b6 UIApplicationMain + 1526
43 Goals 0x0006d0bd main + 141
44 libdyld.dylib 0x0450bac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
It is cause when you change the name of a IBOutlet property in your .h/.m which you've already connected up to File's Owner in the nib.
From your nib:
Select the object in IB and go to the 'Connections Inspector'.
Under 'Referencing Outlets' make sure that your object isn't still connected to the old property name... if it is, click the small 'x' to delete the reference and build again.
1.Unknown class in Interface Builder file Xcode error means one of your ViewController in the StoryBoard linked with the unknown Class. Just Check it carefully.
2.After reading your error report, reason: '[<UIViewController 0x7aecbd00> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key. But lacking of specific codes, I can just recommend you some 'solutions'.
I will write a storeData function as the example. And objectA is the instance variable of your DataObject Class.
func storeData() {
let defaults = NSUserDefaults.standardUserDefaults()
var data = NSKeyedArchiver.archivedDataWithRootObject(objectA)
defaults.setValue(data, forUndefinedKey: "DataBase") // The error occur in there
}
See that data, which is the compression of objectA. And the objectA was inherited from the Class which mentioned in this class is not key value coding-compliant for the key.
The forUndefinedKey is kind of mark or name which leads complier to find correct data.
Solution: I guess the error was occurred in the process of the I/O for data. So check your each I/O function and block to verify that if the un-compression of that parameter, data, inherited from the same Class.
PS: If you gonna use NSUserDefaults to store your data, you should understand NSKeyedArchiver and NSKeyedUnarchiver which like Zip to compress the data. The complier will Archive your data in the processing of storing data and Unarchive the data in the processing of reading the data.

terminating with uncaught exception of type NSException? 'NSInternalInconsistencyException' [duplicate]

This question already has an answer here:
Loaded the nib but didn't get a UITableView Exception
(1 answer)
Closed 8 years ago.
Today I ran my code that hasn't had any errors until now. Whenever someone clicks on the middle tab at the bottom the app crashes completely but all the other tabs work fine. Here's the call stack:
2014-07-01 16:27:19.848 Test Web[66180:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "lwz-qR-aDm-view-tp0-bK-7dP" nib but didn't get a UITableView.'
*** First throw call stack:
(
0 CoreFoundation 0x017f11e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015708e5 objc_exception_throw + 44
2 CoreFoundation 0x017f0fbb +[NSException raise:format:] + 139
3 UIKit 0x0050418e -[UITableViewController loadView] + 281
4 UIKit 0x0034f0d3 -[UIViewController loadViewIfRequired] + 78
5 UIKit 0x0034f5d9 -[UIViewController view] + 35
6 UIKit 0x0038711f -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 407
7 UIKit 0x00386943 -[UITabBarController transitionFromViewController:toViewController:] + 63
8 UIKit 0x00382bed -[UITabBarController _setSelectedViewController:] + 281
9 UIKit 0x00382acc -[UITabBarController setSelectedViewController:] + 180
10 UIKit 0x0038683f -[UITabBarController _tabBarItemClicked:] + 312
11 libobjc.A.dylib 0x01582880 -[NSObject performSelector:withObject:withObject:] + 77
12 UIKit 0x002323b9 -[UIApplication sendAction:to:from:forEvent:] + 108
13 UIKit 0x00232345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
14 UIKit 0x004f6629 -[UITabBar _sendAction:withEvent:] + 479
15 libobjc.A.dylib 0x0158282b -[NSObject performSelector:withObject:] + 70
16 UIKit 0x002323b9 -[UIApplication sendAction:to:from:forEvent:] + 108
17 UIKit 0x00232345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
18 UIKit 0x00333bd1 -[UIControl sendAction:to:forEvent:] + 66
19 UIKit 0x00333fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
20 UIKit 0x00333c06 -[UIControl sendActionsForControlEvents:] + 48
21 UIKit 0x004fb23d -[UITabBar(Static) _buttonUp:] + 123
22 libobjc.A.dylib 0x01582880 -[NSObject performSelector:withObject:withObject:] + 77
23 UIKit 0x002323b9 -[UIApplication sendAction:to:from:forEvent:] + 108
24 UIKit 0x00232345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
25 UIKit 0x00333bd1 -[UIControl sendAction:to:forEvent:] + 66
26 UIKit 0x00333fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
27 UIKit 0x00333243 -[UIControl touchesEnded:withEvent:] + 641
28 UIKit 0x00271ddd -[UIWindow _sendTouchesForEvent:] + 852
29 UIKit 0x002729d1 -[UIWindow sendEvent:] + 1117
30 UIKit 0x002445f2 -[UIApplication sendEvent:] + 242
31 UIKit 0x0022e353 _UIApplicationHandleEventQueue + 11455
32 CoreFoundation 0x0177a77f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
33 CoreFoundation 0x0177a10b __CFRunLoopDoSources0 + 235
34 CoreFoundation 0x017971ae __CFRunLoopRun + 910
35 CoreFoundation 0x017969d3 CFRunLoopRunSpecific + 467
36 CoreFoundation 0x017967eb CFRunLoopRunInMode + 123
37 GraphicsServices 0x037e55ee GSEventRunModal + 192
38 GraphicsServices 0x037e542b GSEventRun + 104
39 UIKit 0x00230f9b UIApplicationMain + 1225
40 Test Web 0x000031fd main + 141
41 libdyld.dylib 0x01e38701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I've tried looking for a solution to this error and checking back over the storyboard but found nothing out of place. Any ideas on a fix?
UITableViewController needs an UITableView connected to it's view property.
Also make sure that the delegate and datasource are properly connected.
If you use xib, make sure that UITableView connected to fileOwner.tableView property.
You probably use xib file to make interface.

Cant find derived class on xcode inspector

I'm new to xcode and objective-c and i have created the base class which is a UIViewController. Let's call it A.
I have also created created an inheriting class B.
Now im trying to use my storyboard and connect it to the relevant B file,
But it wont show on the inspector, only the A file does.
Here are the header files:
A:
#import <UIKit/UIKit.h>
#import "Deck.h"
#interface CardGameViewController : UIViewController
// for subclasses
- (Deck*)createDeck; //abstract
#end
and:
B:
#import "CardGameViewController.h"
#interface PlayingCardViewController : CardGameViewController
#end
Is there any way to pass that? or should B actually be on the inspector?
EDIT:
This is the error i get after forcing the inspector to use the PlayingCardViewController:
2014-01-07 18:24:09.874 Matchismo[80975:70b] Unknown class PlayingCardGameViewController in Interface Builder file.
2014-01-07 18:24:09.893 Matchismo[80975:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x8d841e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cardButtons.'
*** First throw call stack:
(
0 CoreFoundation 0x017415e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014c48b6 objc_exception_throw + 44
2 CoreFoundation 0x017d16a1 -[NSException raise] + 17
3 Foundation 0x011859ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x010f1cfb _NSSetUsingKeyValueSetter + 88
5 Foundation 0x010f1253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x0115370a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x0071fe3a -[UIRuntimeOutletCollectionConnection performConnect] + 690
8 UIKit 0x0071fe75 -[UIRuntimeOutletCollectionConnection connect] + 33
9 libobjc.A.dylib 0x014d67d2 -[NSObject performSelector:] + 62
10 CoreFoundation 0x0173cb6a -[NSArray makeObjectsPerformSelector:] + 314
11 UIKit 0x004d356e -[UINib instantiateWithOwner:options:] + 1417
12 UIKit 0x00345605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
13 UIKit 0x00345dad -[UIViewController loadView] + 302
14 UIKit 0x003460ae -[UIViewController loadViewIfRequired] + 78
15 UIKit 0x003465b4 -[UIViewController view] + 35
16 UIKit 0x0026e9fd -[UIWindow addRootViewControllerViewIfPossible] + 66
17 UIKit 0x0026ed97 -[UIWindow _setHidden:forced:] + 312
18 UIKit 0x0026f02d -[UIWindow _orderFrontWithoutMakingKey] + 49
19 UIKit 0x0027989a -[UIWindow makeKeyAndVisible] + 65
20 UIKit 0x0022ccd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851
21 UIKit 0x002313a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
22 UIKit 0x0024587c -[UIApplication handleEvent:withNewEvent:] + 3447
23 UIKit 0x00245de9 -[UIApplication sendEvent:] + 85
24 UIKit 0x00233025 _UIApplicationHandleEvent + 736
25 GraphicsServices 0x036e82f6 _PurpleEventCallback + 776
26 GraphicsServices 0x036e7e01 PurpleEventCallback + 46
27 CoreFoundation 0x016bcd65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
28 CoreFoundation 0x016bca9b __CFRunLoopDoSource1 + 523
29 CoreFoundation 0x016e777c __CFRunLoopRun + 2156
30 CoreFoundation 0x016e6ac3 CFRunLoopRunSpecific + 467
31 CoreFoundation 0x016e68db CFRunLoopRunInMode + 123
32 UIKit 0x00230add -[UIApplication _run] + 840
33 UIKit 0x00232d3b UIApplicationMain + 1225
34 Matchismo 0x000038dd main + 141
35 libdyld.dylib 0x01d7f70d start + 1
36 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Go to the Product menu in Xcode and choose Clean. Sometimes that fixes weird issues like this.

'NSInternalInconsistencyException' - unable to push uitableviewcontroller on uinavigationcontroller ios 6

I am simply pushing a UITableviewController to navigation stack. Code works fine in both iOS 4.3 and 5 but crashes in iOS 6. Exception is:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MenuController" nib but the view outlet was not set.'
I know this exception is raised when view outlet is not set. Outlet is set automatically by IB as you can see in figure, but still the same. What am I doing wrong?
Simple code pushing the controller:
MenuController *menu = [[MenuController alloc] initWithStyle:UITableViewStylePlain];
menu.title = #"Watches";
menu.MenuToBeDisplayed = #"main menu";
[self.navigationController pushViewController:menu animated:YES];
Stack trace is:
0 CoreFoundation 0x01f3e02e __exceptionPreprocess + 206
1 libobjc.A.dylib 0x01a12e7e objc_exception_throw + 44
2 CoreFoundation 0x01f3ddeb +[NSException raise:format:] + 139
3 UIKit 0x00a3af18 -[UIViewController _loadViewFromNibNamed:bundle:] + 505
4 UIKit 0x00a3b418 -[UIViewController loadView] + 302
5 UIKit 0x00b8934e -[UITableViewController loadView] + 80
6 UIKit 0x00a3b648 -[UIViewController loadViewIfRequired] + 73
7 UIKit 0x00a3b882 -[UIViewController view] + 33
8 UIKit 0x00a3bb2a -[UIViewController contentScrollView] + 36
9 UIKit 0x00a52ef5 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 36
10 UIKit 0x00a52fdb -[UINavigationController _layoutViewController:] + 43
11 UIKit 0x00a53286 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 254
12 UIKit 0x00a53381 -[UINavigationController _startTransition:fromViewController:toViewController:] + 72
13 UIKit 0x00a53eab -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
14 UIKit 0x00a544a3 -[UINavigationController pushViewController:transition:forceImmediate:] + 1030
15 UIKit 0x00a54098 -[UINavigationController pushViewController:animated:] + 62
16 Tick 0x000e5f02 -[MarketWatchViewController openMenu] + 274
17 libobjc.A.dylib 0x01a26705 -[NSObject performSelector:withObject:withObject:] + 77
18 UIKit 0x0095d920 -[UIApplication sendAction:to:from:forEvent:] + 96
19 UIKit 0x00b99b24 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 139
20 libobjc.A.dylib 0x01a26705 -[NSObject performSelector:withObject:withObject:] + 77
21 UIKit 0x0095d920 -[UIApplication sendAction:to:from:forEvent:] + 96
22 UIKit 0x0095d8b8 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
23 UIKit 0x00a1e671 -[UIControl sendAction:to:forEvent:] + 66
24 UIKit 0x00a1ebcf -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 578
25 UIKit 0x00a1dd38 -[UIControl touchesEnded:withEvent:] + 546
26 UIKit 0x0098d33f -[UIWindow _sendTouchesForEvent:] + 846
27 UIKit 0x0098d552 -[UIWindow sendEvent:] + 273
28 UIKit 0x0096b3aa -[UIApplication sendEvent:] + 436
29 UIKit 0x0095ccf8 _UIApplicationHandleEvent + 9874
30 GraphicsServices 0x0291adf9 _PurpleEventCallback + 339
31 GraphicsServices 0x0291aad0 PurpleEventCallback + 46
32 CoreFoundation 0x01eb3bf5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
33 CoreFoundation 0x01eb3962 __CFRunLoopDoSource1 + 146
34 CoreFoundation 0x01ee4bb6 __CFRunLoopRun + 2118
35 CoreFoundation 0x01ee3f44 CFRunLoopRunSpecific + 276
36 CoreFoundation 0x01ee3e1b CFRunLoopRunInMode + 123
37 GraphicsServices 0x029197e3 GSEventRunModal + 88
38 GraphicsServices 0x02919668 GSEventRun + 104
39 UIKit 0x0095a65c UIApplicationMain + 1211
40 Tick 0x00002dc5 main + 197
41 Tick 0x00002cb5 start + 53
EDIT:
I have removed nib file, and also initWithNibName: method, but I am still getting this stupid exception since yesterday. This will drive me crazy :(
With
MenuController *menu = [[MenuController alloc] initWithStyle:UITableViewStylePlain];
You aren't using your xib file at all becouse for initing contreoller with xib you need to use
initWithNibName:bundle: instead of initWithStyle:
and then set your controller's class on xib like this

Resources