Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

reputationZed

macrumors 65816
Original poster
I'm working through the Control Fun project in Apress's Beginning iOS 5 Development and ran into a bit of a problem. After connecting the two switches (leftSwitch and rightSwitch) I encountered a build failure. I traced the failure to having mistyped rightSwitch as rightSwirch. I went through my code and made the corrections. The build now succeeds but the program crashes after trying to load the iOS simulator with the following error
Code:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<BIDViewController 0x6bbde50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key rightSwirch.'
I've been through my code a few times and can not find anymore references to rightSwirch and the fact that the build is successful makes me think I got them all. I tried deleting the control and all reference to it and then adding the control and making the connections again but I'm getting the same SIGABRT error. Any ideas?
 
Last edited:
The problem is in the nib. The nib is still looking for an outlet with the misspelled name.

Look in the nib and right click or control-click on the File's Owner. Look for your bad outlet and delete it. It will be marked in yellow. Then add a new outlet with the new name or connect the rightSwitch to the outlet of that name.

Xcode has a rename feature under the Edit menu that you can use to rename a variable or class name but I don't know if it renames inside the nib also.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.