Very annoying GDB Problem

Discussion in 'iOS Programming' started by willmeister, Jun 13, 2010.

  1. willmeister macrumors newbie

    Joined:
    Jun 13, 2010
    #1
    I cannot understand why the GDB craps out saying "unrecognized selector" when there it is connected to the appropriate method inside Interface Builder. What I have to add is that I'm using a View Controller, and the IBAction is defined inside the view controller.

    Program compiles fine with no warnings but every time I press a button, the application abruptly terminates.

    Any thoughts?
     
  2. xsmasher macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
  3. willmeister thread starter macrumors newbie

    Joined:
    Jun 13, 2010
    #3
    I've tried changing the argument classes as if that would help but tried anyway.
    Made sure I named things correctly and everything was connected up properly in IB. I just can't figure out where I went wrong. The only argument is of type id coming from a UIButton so... the instance, I'm pretty sure is my UIViewController with the action method.

    - (IBAction) pushController: (id) sender;

    I've tried:

    - (IBAction) pushController: (UIButton *) sender;

    Another thing I've noticed is that when I try to add a button to the ViewController's view it doesn't show up at all.
     
  4. willmeister thread starter macrumors newbie

    Joined:
    Jun 13, 2010
    #4
    You know when you make such ... basic mistakes you don't see them?

    Turns out that UIViewController doesn't have a defined action called pushController. That will be found in *my* custom UIViewController.

    What I did was

    UIViewController *rootViewController = [[UIViewController alloc] initWith...]

    etc etc etc

    Helps when one uses their own custom classes to get custom behaviours. :p
     

Share This Page