SIGABRT issue

Discussion in 'iOS Programming' started by reputationZed, May 4, 2012.

  1. reputationZed, May 4, 2012
    Last edited: May 4, 2012

    reputationZed macrumors 65816

    Joined:
    Mar 9, 2011
    Location:
    34°55′42″N 80°44′41″W (34.
    #1
    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?
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    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.
     
  3. reputationZed thread starter macrumors 65816

    Joined:
    Mar 9, 2011
    Location:
    34°55′42″N 80°44′41″W (34.
    #3
    Brilliant, thanks for the help, your solution was spot on.
     

Share This Page