Updating ObjC app on XCode 9 - objective-c

I recently updated our ObjC app on XCode 9. Everything was ok (I even updated to iPhone X new layout), there has been just an issue in one of the viewControllers (built in IB). This viewController, which shows a tableView with news, can be accessed from 2 sources:
From appDelegate if a Push Notification informs about new news. In this case, a right navBarButton is unhidden so the user can dismiss the view
From a specific section, where a normal back button is used
When I try to open the viewController from the second case, the app crashes with the next message:
2017-10-17 12:53:26.747396-0500 verifica[17299:1270771] * Assertion failure in -[_UIButtonBarButtonVisualProviderIOS _addConstraintsForBackgroundImageWithOffset:isBackButton:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3694.4.18/_UIButtonBarButtonVisualProviderIOS.m:485
2017-10-17 12:53:26.855489-0500 verifica[17299:1270771] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '_UIButtonBarButtonVisualProviderIOS cannot have a background without any content'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ba151cb exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010af48f41 objc_exception_throw + 48
2 CoreFoundation 0x000000010ba1a362 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000106a22089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x000000010860cd92 -[_UIButtonBarButtonVisualProviderIOS _addConstraintsForBackgroundImageWithOffset:isBackButton:] + 1079
5 UIKit 0x000000010860c903 -[_UIButtonBarButtonVisualProviderIOS _configureBackgroundForButton:fromBarButtonItem:isBackButton:] + 1060
6 UIKit 0x0000000108610610 -[_UIButtonBarButtonVisualProviderIOS configureButton:fromBarButtonItem:] + 2630
7 UIKit 0x000000010860dcaf -[_UIButtonBarButtonVisualProviderIOS configureButton:withAppearanceDelegate:fromBarItem:] + 148
8 UIKit 0x0000000107ff3096 -[_UIButtonBarButton _configureFromBarItem:appearanceDelegate:isBackButton:] + 86
9 UIKit 0x0000000107ff2c20 -[_UIButtonBarButton configureFromBarItem:withAppearanceDelegate:] + 53
10 UIKit 0x00000001085a2049 -[_UIButtonBar _updatedViewForBarButtonItem:withView:] + 338
11 UIKit 0x00000001085a0add __32-[_UIButtonBar _newGroupLayout:]_block_invoke + 82
12 UIKit 0x00000001085960d3 -[_UIButtonBarItemLayout _updateItemView] + 53
13 UIKit 0x000000010859667c -[_UIButtonBarItemLayout _configure] + 40
14 UIKit 0x000000010859518f -[_UIButtonBarLayout configure] + 60
15 UIKit 0x00000001085952d9 -[_UIButtonBarLayout addLayoutViews:] + 49
16 UIKit 0x000000010859864e -[_UIButtonBarItemGroupLayout _iterateConfiguredLayouts:] + 228
17 UIKit 0x000000010859872f -[_UIButtonBarItemGroupLayout _addLayoutViews:] + 116
18 UIKit 0x000000010859523d -[_UIButtonBarLayout addLayoutViews:layoutGuides:constraintsToActivate:constraintsToDeactivate:] + 111
19 UIKit 0x00000001085a1264 -[_UIButtonBar _layoutBar] + 1833
20 UIKit 0x00000001085a3b44 -[_UIButtonBarStackView updateConstraints] + 48
21 UIKit 0x000000010870d8b6 -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 161
22 UIKit 0x000000010870ded2 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 1296
23 UIKit 0x000000010870dd51 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 911
24 Foundation 0x00000001069acde1 -[NSISEngine withBehaviors:performModifications:] + 131
25 UIKit 0x000000010870e703 __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 90
26 UIKit 0x000000010870cf61 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 104
27 UIKit 0x000000010870e272 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 160
28 UIKit 0x000000010870f38c -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 401
29 UIKit 0x0000000107c671b6 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1517
30 UIKit 0x00000001084a74cd -[_UINavigationBarTransitionContextPush _prepareContentView] + 130
31 UIKit 0x00000001084a8b2b -[_UINavigationBarTransitionContextPush prepare] + 133
32 UIKit 0x000000010878d15a -[_UINavigationBarVisualProviderModernIOS _performAnimationWithTransitionCompletion:transition:] + 740
33 UIKit 0x0000000107cb60b6 -[UINavigationBar _pushNavigationItem:transitionAssistant:] + 359
34 UIKit 0x0000000107cb58e2 -[UINavigationBar _pushNavigationItemUsingCurrentTransition:] + 368
35 UIKit 0x0000000107cb5a47 -[UINavigationBar pushNavigationItem:animated:] + 179
36 UIKit 0x0000000107cb02cf -[UINavigationBar _performUpdatesIgnoringLock:] + 47
37 UIKit 0x0000000107cb5b51 -[UINavigationBar _pushNavigationItem:transition:] + 152
38 UIKit 0x0000000107d97f37 __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 371
39 UIKit 0x0000000107d9812c __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke.1981 + 114
40 UIKit 0x0000000107d92bcf __98-[UINavigationController _shouldSkipHostedRefreshControlUpdateSchedulingDeferredUpdateIfNecessary]_block_invoke + 18
41 UIKit 0x0000000107d94b25 -[UINavigationController _startDeferredTransitionIfNeeded:] + 1343
42 UIKit 0x0000000107d95b90 -[UINavigationController __viewWillLayoutSubviews] + 115
43 UIKit 0x0000000107fec2ae -[UILayoutContainerView layoutSubviews] + 231
44 UIKit 0x0000000128bc4a9f -[UILayoutContainerViewAccessibility layoutSubviews] + 42
45 UIKit 0x0000000107c7c551 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1331
46 QuartzCore 0x000000010773a4ba -[CALayer layoutSublayers] + 153
47 QuartzCore 0x000000010773e5a9 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 401
48 QuartzCore 0x00000001076c71cd _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 365
49 QuartzCore 0x00000001076f2ae4 _ZN2CA11Transaction6commitEv + 500
50 UIKit 0x0000000107bd8687 _afterCACommitHandler + 272
51 CoreFoundation 0x000000010b9b7db7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
52 CoreFoundation 0x000000010b9b7d0e __CFRunLoopDoObservers + 430
53 CoreFoundation 0x000000010b99c324 __CFRunLoopRun + 1572
54 CoreFoundation 0x000000010b99ba89 CFRunLoopRunSpecific + 409
55 GraphicsServices 0x000000010f3fd9c6 GSEventRunModal + 62
56 UIKit 0x0000000107badd30 UIApplicationMain + 159
57 verifica 0x0000000103ce9f0f main + 111
58 libdyld.dylib 0x000000010ac32d81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
The app worked fine before XCode 9. I've run it in the simulator (with iOS, 10.3, 10.3.1 & 11) and on an iPhone with iOS 11, and crashes all the time for case 2.
I've searched several of the terms referred in the console, but the only similar was http://www.cocoachina.com/bbs/read.php?tid-1726269.html, I used Google Translate and one guy says: "mainly due to the navigantionBarItem picture and the location of the text caused by the offset".
As I said the view was built in IB with a normal Navigation Controller, no offset in the button. The only difference with other similar viewControllers that work fine is the right navBarButton that is shown in case 1 but not in case 2 with the next code in viewDidLoad:
if (self.fromAppDelegate) {
self.doneButton.title = #"Cerrar";
self.doneButton.enabled = YES;
} else self.doneButton.enabled = NO;
I'm sure its gonna be an easy solution but right now I can't find it. I hope someone can help me.
Update
These are this button's configuration in IB:
InterfaceBuilder: Button

OK, when I was checking the configuration for the button in IB, I noticed that its width (Size Inspector) was zero. I changed it to 80 so, the button shows now in the preview. I also, in Attributes Inspector, changed it from Custom system item to Done and in code added the next line for the else statement:
self.doneButton.title = #"";
It worked, the app didn't crash anymore, but the button, if not enabled, was visible as Done all the time which is not what I want (the code above didn't work because it was set as System Button, duh). So, I change it back to Custom and delete the default title aaaand... everything was as before (check image in the question), but the app still works. What? Well, not everything was as before: the code above was the only change. If I commented the line, the app crashes again.
I don't know if it's a bug or a new requirement, but I hope it useful for someone (I knew the answer was gonna be easy).

Related

animated circle on map with iOS 7

I am using YHAnimatedCircleView (http://yickhong-ios.blogspot.it/2012/04/animated-circle-on-mkmapview.html) to display an animated circle on a map. It works well with iOS6, while I am experiencing some problems with iOS7.
The circle appears after a long period on the map and it returns me the following error:
CoreAnimation: warning, deleted thread with uncommitted CATransaction;
0 QuartzCore 0x00fcfa96 _ZN2CA11Transaction4pushEv + 374
1 QuartzCore 0x00fcfe72 _ZN2CA11Transaction15ensure_implicitEv + 316
2 QuartzCore 0x0106791b _ZN2CA5Layer12begin_changeEPNS_11TransactionEjRP11objc_object + 37
3 QuartzCore 0x0106914e _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 290
4 QuartzCore 0x010692a9 -[CALayer setPosition:] + 68
5 QuartzCore 0x010699af -[CALayer setFrame:] + 799
6 UIKit 0x0126329c -[UIView(Geometry) setFrame:] + 302
7 UIKit 0x01361d50 -[UIImageView _setViewGeometry:forMetric:] + 210
8 UIKit 0x01361fae -[UIImageView setFrame:] + 63
9 SampleApp 0x0001d331 -[YHAnimatedCircleView drawMapRect:zoomScale:inContext:] + 1329
10 MapKit 0x00c1b8ff __43-[MKOverlayView overlay:drawKey:inContext:]_block_invoke + 847
11 MapKit 0x00c1b572 -[MKOverlayView overlay:drawKey:inContext:] + 268
12 VectorKit 0x0bff941d -[VKRasterOverlay drawKey:inContext:] + 61
13 VectorKit 0x0bff75e5 __40-[VKRasterOverlayTileSource _queueDraw:]_block_invoke + 485
14 libdispatch.dylib 0x0647d818 _dispatch_call_block_and_release + 15
15 libdispatch.dylib 0x064924b0 _dispatch_client_callout + 14
I dont know exactly what your Framework is doing but the drawing of layers shouldn't be done in the main thread. So like in this thread discussed and solved, you should just use an async-dispatcher.
dispatch_async(dispatch_get_main_queue(), ^{
[_mapView addOverlay:circle];
});
Here is an example that updated the YickHong solution for iOS7.
https://github.com/jhurray/iOS7AnimatedMapOverlay
In iOS7, you can no longer add subviews to an MKOverlay. Check out the code here and ping me if you have any questions jeff#energ.io.

Firing segues failing

I have a storyboard.
In this storyboard there is a UITableViewController that uses a custom class, comMasterViewController.
Using the storyboard, I simply control-drag from the UITableViewController to another scene.
A modal segue is created. I change its identifier to "loadingDataSegue".
In my UITableViewController code, I fire this line:
[self performSegueWithIdentifier:#"loadingDataSegue" sender:nil];
I receive:
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'Receiver (<comMasterViewController: 0x1b6290>) has no segue with
identifier 'loadingDataSegue''
What isn't being hooked up properly?
Thanks for the help
EDIT:
I am pretty sure I am linking the TVC, and not any of the subviews. Looking at the storyboard code, I see the following:
<tableViewController storyboardIdentifier="comMasterViewController"
title="comMasterViewController" clearsSelectionOnViewWillAppear="NO" id="19"
userLabel="comMasterViewController" customClass="comMasterViewController"
sceneMemberID="viewController">
and at the bottom, as a child tag to <tableViewController> and not to any of its subviews:
<connections>
<segue destination="UCh-sM-lba" kind="modal" identifier="loadingDataSegue"
id="epP-jH-GLZ"/>
</connections>
Here is the stacktrace:
0 CoreFoundation
0x363388a7 __exceptionPreprocess + 186
1 libobjc.A.dylib
0x3758d259 objc_exception_throw + 32
2 UIKit
0x31193a3f -[UIViewController performSegueWithIdentifier:sender:] + 154
3 EZSystem
0x000bdfe7 -[comMasterViewController insertNewObject:] + 58
4 CoreFoundation
0x362923fd -[NSObject performSelector:withObject:withObject:] + 52
5 UIKit
0x30fc8faf -[UIApplication sendAction:to:from:forEvent:] + 62
6 UIKit
0x3108e76b -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 118
7 CoreFoundation
0x362923fd -[NSObject performSelector:withObject:withObject:] + 52
8 UIKit
0x30fc8faf -[UIApplication sendAction:to:from:forEvent:] + 62
9 UIKit
0x30fc8f6b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
10 UIKit
0x30fc8f49 -[UIControl sendAction:to:forEvent:] + 44
11 UIKit
0x30fc8cb9 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 492
12 UIKit
0x30fc95f1 -[UIControl touchesEnded:withEvent:] + 476
13 UIKit
0x30fc7ad3 -[UIWindow _sendTouchesForEvent:] + 318
14 UIKit
0x30fc74c1 -[UIWindow sendEvent:] + 380
15 UIKit
0x30fad83d -[UIApplication sendEvent:] + 356
16 UIKit
0x30fad0e3 _UIApplicationHandleEvent + 5826
17 GraphicsServices
0x3264f22b PurpleEventCallback + 882
18 CoreFoundation
0x3630c523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
19 CoreFoundation
0x3630c4c5 __CFRunLoopDoSource1 + 140
20 CoreFoundation
0x3630b313 __CFRunLoopRun + 1370
21 CoreFoundation
0x3628e4a5 CFRunLoopRunSpecific + 300
22 CoreFoundation
0x3628e36d CFRunLoopRunInMode + 104
23 GraphicsServices
0x3264e439 GSEventRunModal + 136
24 UIKit
0x30fdbe7d UIApplicationMain + 1080
25 EZSystem
0x0009f963 main + 86
26 EZSystem
0x0009f908 start + 40
Here is an image:
Make sure you didn't drag that Segue from a TableView Row or UIButton and instead from the VC itself. If you are in doubt, delete the segue and connect it again. Also check for typo's (including case) if that doesn't solve your issue.
I had this exact problem(the symptoms anyway) and ElJay gave me the hint I needed. My problem was caused by the TableViewController being inside a NavigationController and it was opened by an alloc init and push using the NavigationController. This was the reason [self performSegueWithIdentifier] didn't work. Even more, this was also the reason the segue I created from the cell didn't work, so now I don't even need the [self perform...] part, just prepareForSegue and everything works like a charm.
I would have replied this to ElJay, but for some reason I can't. All I could do was give him a vote.

Bizarre key-value coding error for basic UILabel

This is a new one. I'm testing that my various viewcontrollers are getting loaded by my tab bar, so I put this on one of them:
- (void)viewDidLoad
{
[super viewDidLoad];
UILabel*yo=[[UILabel alloc] init];
self.testlabel=yo;
self.testlabel.text=[NSString stringWithFormat:#"sup"];
[yo release];
This is what I get when I click the tab button for that controller:
2011-07-26 14:05:37.773 Pickers[802:707] Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key testlabel.'*
What in the world?! I must be doing something exceptionally basic and wrong here. Can anyone spot it?
I've got this in the .h and .m:
#interface SingleVC : UIViewController
#property (nonatomic, retain) IBOutlet UILabel*testlabel;
#end
and
#implementation SingleVC
#synthesize testlabel;
I get the following stack errors (which I do not know how to read):
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f16313 objc_exception_throw + 44
2 CoreFoundation 0x00dc24e1 -[NSException raise] + 17
3 Foundation 0x00794677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x007945e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0021030c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d388cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x0020ed23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x00210ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x000c6628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x000c4134 -[UIViewController loadView] + 120
11 UIKit 0x000c400e -[UIViewController view] + 56
12 UIKit 0x000d6f54 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 120
13 UIKit 0x000d5aaa -[UITabBarController transitionFromViewController:toViewController:] + 64
14 UIKit 0x000d78a2 -[UITabBarController _setSelectedViewController:] + 263
15 UIKit 0x000d7711 -[UITabBarController _tabBarItemClicked:] + 352
16 UIKit 0x000144fd -[UIApplication sendAction:to:from:forEvent:] + 119
17 UIKit 0x00216ce6 -[UITabBar _sendAction:withEvent:] + 422
18 UIKit 0x000144fd -[UIApplication sendAction:to:from:forEvent:] + 119
19 UIKit 0x000a4799 -[UIControl sendAction:to:forEvent:] + 67
20 UIKit 0x000a6c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
21 UIKit 0x000a4750 -[UIControl sendActionsForControlEvents:] + 49
22 UIKit 0x000144fd -[UIApplication sendAction:to:from:forEvent:] + 119
23 UIKit 0x000a4799 -[UIControl sendAction:to:forEvent:] + 67
24 UIKit 0x000a6c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
25 UIKit 0x000a57d8 -[UIControl touchesEnded:withEvent:] + 458
26 UIKit 0x00038ded -[UIWindow _sendTouchesForEvent:] + 567
27 UIKit 0x00019c37 -[UIApplication sendEvent:] + 447
28 UIKit 0x0001ef2e _UIApplicationHandleEvent + 7576
29 GraphicsServices 0x00ffb992 PurpleEventCallback + 1550
30 CoreFoundation 0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
31 CoreFoundation 0x00d03cf7 __CFRunLoopDoSource1 + 215
32 CoreFoundation 0x00d00f83 __CFRunLoopRun + 979
33 CoreFoundation 0x00d00840 CFRunLoopRunSpecific + 208
34 CoreFoundation 0x00d00761 CFRunLoopRunInMode + 97
35 GraphicsServices 0x00ffa1c4 GSEventRunModal + 217
36 GraphicsServices 0x00ffa289 GSEventRun + 115
37 UIKit 0x00022c93 UIApplicationMain + 1160
38 Pickers 0x000025c9 main + 121
39 Pickers 0x00002545 start + 53
)
terminate called throwing an exceptionCurrent language: auto; currently objective-c
kill
quit
So after some Googling on other sites, it turns out that quite a few people have had this exact same and basic problem. I found the solution here:
https://discussions.apple.com/thread/1598422?threadID=1598422
I was checking my classes within the individual nibs of each controller, but you must also set the classes in the tab controller as well, for each item (I had already set the nib name for each tab bar item, but not the class).
so, problem resolved and was, as expected, quite basic.
It's a stumper why the error created was for key value coding, though.
perhaps a connection in IB from some object that formerly had an IBOutlet called testlabel?
stop the debugger in ObjC Exceptions and post your stack trace if it's not obvious

Weird problems with program and debugger in xcode

Okay, I have a program that I'm trying to test on my iPad. I have it all set up so that the app is able to get on the iPad just fine, but running it on the iPad is a different story.
Now, the thing is, my program was working fine on the debug configuration, but now it won't work on that, either. It's strange, because before I was able to get to a certain part of the program before it crashed, but now it's crashing before that.
The debugger is hardly helping. When I use the debugger window, it will step into one line of code, and then suddenly jump back to another line of code.
I really don't understand what's going on. The crash is now occuring in a root view controller that I have set up, called 'FunctionMachineViewController. Here's the code for when it crashes:
-(IBAction)startOnePlayer:(id)sender
{
GameViewController* GameView = [[GameViewController alloc] initWithNibName:nil bundle:nil];
[GameView isOnePlayer:YES withLevel:startLevelNumber];
[self presentModalViewController:GameView animated:YES];
}
GameViewController is supposed to initialize just fine, but the debugger shows it as uninitialized. I even tried setting it up in the header file instead, but the problem still happens. Has anyone else come across these problems? Any help would be greatly appreciated!
EDIT: Here's what the console says when it crashes:
[Session started at 2011-06-02 21:46:10 -0700.]
2011-06-02 21:46:13.309 FunctionMachine[5033:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<GameViewController 0x4b2a890> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Yminus2.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dd55a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f29313 objc_exception_throw + 44
2 CoreFoundation 0x00dd54e1 -[NSException raise] + 17
3 Foundation 0x0003d677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003d5e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004c130c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d4b8cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004bfd23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004c1ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x00377628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x00375134 -[UIViewController loadView] + 120
11 UIKit 0x0037500e -[UIViewController view] + 56
12 UIKit 0x00376a3d -[UIViewController viewControllerForRotation] + 63
13 UIKit 0x00372988 -[UIViewController _visibleView] + 90
14 UIKit 0x0061493c -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 354
15 UIKit 0x002ec81e -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 954
16 UIKit 0x00574619 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1381
17 UIKit 0x0037965d -[UIViewController presentModalViewController:withTransition:] + 3478
18 FunctionMachine 0x00001fdd -[FunctionMachineViewController startOnePlayer:] + 227
19 UIKit 0x002c54fd -[UIApplication sendAction:to:from:forEvent:] + 119
20 UIKit 0x00355799 -[UIControl sendAction:to:forEvent:] + 67
21 UIKit 0x00357c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
22 UIKit 0x00356a1c -[UIControl touchesBegan:withEvent:] + 277
23 UIKit 0x002e9d41 -[UIWindow _sendTouchesForEvent:] + 395
24 UIKit 0x002cac37 -[UIApplication sendEvent:] + 447
25 UIKit 0x002cff2e _UIApplicationHandleEvent + 7576
26 GraphicsServices 0x0172d992 PurpleEventCallback + 1550
27 CoreFoundation 0x00db6944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
28 CoreFoundation 0x00d16cf7 __CFRunLoopDoSource1 + 215
29 CoreFoundation 0x00d13f83 __CFRunLoopRun + 979
30 CoreFoundation 0x00d13840 CFRunLoopRunSpecific + 208
31 CoreFoundation 0x00d13761 CFRunLoopRunInMode + 97
32 GraphicsServices 0x0172c1c4 GSEventRunModal + 217
33 GraphicsServices 0x0172c289 GSEventRun + 115
34 UIKit 0x002d3c93 UIApplicationMain + 1160
35 FunctionMachine 0x00001c64 main + 102
36 FunctionMachine 0x00001bf5 start + 53
37 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Turns out that, when I went and changed the name of several UILabels in the header of GameViewController, I forgot to fix the names in the interface builder, too. Don't know if that was what was causing the debugger to act weird, but everything is working now!

Object handling error in iPhone, select tab in UITabView and crash

Hey everyone, I'm creating a tab-view application, and in the one tab I have 7 textFields that I am trying to save the information for with a "Save" button. After making the connections between the objects in my controller.h file and the actual text fields, when I select the tab with all this stuff in it, the application crashes and goes to the springboard. I have the debug here:
2011-02-23 08:49:02.522 Tow Boat 911[19138:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x4e0d1d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key colour.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00ec6be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00cbb5c2 objc_exception_throw + 47
2 CoreFoundation 0x00ec6b21 -[NSException raise] + 17
3 Foundation 0x000286cf _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0002863d -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004a78d6 -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00e3d2cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004a62ed -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004a8081 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x00360a94 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x0035e709 -[UIViewController loadView] + 120
11 UIKit 0x0035e5e3 -[UIViewController view] + 56
12 UIKit 0x00371230 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 120
13 UIKit 0x0036fd86 -[UITabBarController transitionFromViewController:toViewController:] + 64
14 UIKit 0x00371b7e -[UITabBarController _setSelectedViewController:] + 263
15 UIKit 0x003719ed -[UITabBarController _tabBarItemClicked:] + 352
16 UIKit 0x002b0a6e -[UIApplication sendAction:to:from:forEvent:] + 119
17 UIKit 0x004ae1f2 -[UITabBar _sendAction:withEvent:] + 422
18 UIKit 0x002b0a6e -[UIApplication sendAction:to:from:forEvent:] + 119
19 UIKit 0x0033f1b5 -[UIControl sendAction:to:forEvent:] + 67
20 UIKit 0x00341647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
21 UIKit 0x0033f16c -[UIControl sendActionsForControlEvents:] + 49
22 UIKit 0x002b0a6e -[UIApplication sendAction:to:from:forEvent:] + 119
23 UIKit 0x0033f1b5 -[UIControl sendAction:to:forEvent:] + 67
24 UIKit 0x00341647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
25 UIKit 0x003401f4 -[UIControl touchesEnded:withEvent:] + 458
26 UIKit 0x002d50d1 -[UIWindow _sendTouchesForEvent:] + 567
27 UIKit 0x002b637a -[UIApplication sendEvent:] + 447
28 UIKit 0x002bb732 _UIApplicationHandleEvent + 7576
29 GraphicsServices 0x016dda36 PurpleEventCallback + 1550
30 CoreFoundation 0x00ea8064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
31 CoreFoundation 0x00e086f7 __CFRunLoopDoSource1 + 215
32 CoreFoundation 0x00e05983 __CFRunLoopRun + 979
33 CoreFoundation 0x00e05240 CFRunLoopRunSpecific + 208
34 CoreFoundation 0x00e05161 CFRunLoopRunInMode + 97
35 GraphicsServices 0x016dc268 GSEventRunModal + 217
36 GraphicsServices 0x016dc32d GSEventRun + 115
37 UIKit 0x002bf42e UIApplicationMain + 1160
38 Tow Boat 911 0x00001df8 main + 102
39 Tow Boat 911 0x00001d89 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
Thanks everyone for any help in advance!
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key colour.
In this case check the following:
Ensure that you have not misspelled the key you are trying to access i.e. colour.
The class attribute you are trying to access i.e. colour should be Key Value compliant. You can have the attribute declared as a property in header and synthesize the same in the implementation file. Do not change the default name for the getter and setter in the property declaration. The default method name/signature is KVC compliant.
Apple documentation on KVC covering the accessor method code: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueCoding/Articles/Overview.html
If you are using core data ensure that the property being accessed is present in the corresponding header file and also has its code in the implementation file. It can happen that you have added this property later to the model and have not updated the generated header and implementation file.
Came across this post without an answer so thought I would put a response which may help someone else.