Bizarre. Getting an error from the Stanford iOS Class, but my code seems identical.

Discussion in 'iOS Programming' started by Doju, Apr 23, 2012.

  1. Doju macrumors 68000

    Jun 16, 2008
    I believe I did what the instructor did verbatim (it's the famous Stanford class available in iTunes U for iOS Programming), but my app (it's a simple app) won't work and errors out if I press a button.

    I click run, and it builds, but when I click a button in the iOS simulator the app crashes and brings me back to Xcode with an error.


    I don't know what I did wrong. It brings me to the main.m file when we didn't even deal with that in the Stanford guide (maybe it has to do with the fact that the Stanford guide uses iOS 5.0 and I'm on 5.1?).

    Here's the project if anyone wants to take a lot at it. I'm just really confused.

    (Also, did I just need to include the xcodeproject file, or was I right in including the whole project folder in a zip file?)

  2. cMacSW macrumors regular

    Mar 20, 2006
    You have an unhandled exception somewhere in your app, I know that's not helpful;)

    Can you provide the call stack when the debugger is stopped, that helps determine the general area of the problem.
  3. Doju thread starter macrumors 68000

    Jun 16, 2008
    Gladly, if you could tell me how to do that. :eek:
  4. Doju thread starter macrumors 68000

    Jun 16, 2008
    Do you mean this?

    2012-04-23 16:34:18.557 Calculator[14405:f803] -[CalculatorViewController digitedPressed:]: unrecognized selector sent to instance 0x6a8fbc0
    2012-04-23 16:34:18.559 Calculator[14405:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CalculatorViewController digitedPressed:]: unrecognized selector sent to instance 0x6a8fbc0'
    *** First throw call stack:
    (0x13c7022 0x1558cd6 0x13c8cbd 0x132ded0 0x132dcb2 0x13c8e99 0x1414e 0x140e6 0xbaade 0xbafa7 0xba266 0x393c0 0x395e6 0x1fdc4 0x13634 0x12b1ef5 0x139b195 0x12ffff2 0x12fe8da 0x12fdd84 0x12fdc9b 0x12b07d8 0x12b088a 0x11626 0x1fcd 0x1f35)
    terminate called throwing an exception(lldb) 
  5. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Is "digitPressed:" in your header? Is it in the corresponding main? Was your object released at some point when it shouldn't have been?
  6. robbieduncan Moderator emeritus


    Jul 24, 2002
    digitPressed: doesn't have to be in the header to prevent runtime errors only to prevent compile time warnings. But that's irrelevant as the error is about a method called digitedPressed:. I suspect it's meant to be digitPressed: but there is a typo somewhere (I would expect a compiler warning if it's in the text somewhere, not sure about if it's in a xib).

Share This Page