Jamie Rumbelow
Jamie Rumbelow

Reputation: 5095

Unrecognized selector sent to instance on UIViewController

I've got a really annoying problem, and as much as I've searched, I can't find the answer. My app is terminating when I try to view a TableView. The data source and delegate is set to the File's owner, which implements the protocol.

alt text http://grab.by/2IJV

alt text http://grab.by/2IK7

The error I'm getting looks like this:

[Session started at 2010-02-27 16:28:24 +0000.]
2010-02-27 16:28:27.209 Moola[28564:207] Unknown class FirstViewController in Interface Builder file.
2010-02-27 16:28:28.189 Moola[28564:207] *** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5005900
2010-02-27 16:28:28.190 Moola[28564:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x5005900'
2010-02-27 16:28:28.190 Moola[28564:207] Stack: (
    40692267,
    2469430537,
    40961963,
    40426854,
    40423522,
    4542959,
    4550376,
    4549359,
    3202411,
    3139508,
    3189226,
    3176954,
    68444159,
    68443501,
    68441542,
    68440628,
    68472982,
    40444146,
    40231701,
    40228984,
    49023565,
    49023762,
    2840157,
    9184,
    9038
)

Finally, here's the implementation file (SettingsController.m) of the SettingsController class:

alt text http://grab.by/2ILu

I'm sure this is a trivial problem for a pro, but I come from a highly web-based background, and only dabbled in C a while a few years back. To be truthful, it's hurting my head.

Thanks,

Jamie

Upvotes: 2

Views: 4027

Answers (2)

Frank Shearar
Frank Shearar

Reputation: 17132

Are you sure that the receiver is indeed a SettingsController? Try

NSLog(@"receiver's type: %@", NSStringFromClass([foo class]));

just before the call that fails (and of course change "foo" to whatever the receiver's actual name is).

Upvotes: 0

Ben Zotto
Ben Zotto

Reputation: 71008

What is FirstViewController as referenced in this disconcerting log line? Could it be some leftover reference that Interface Builder is actually trying to instantiate instead of your SettingsController?

2010-02-27 16:28:27.209 Moola[28564:207] Unknown class FirstViewController in Interface Builder file.

Upvotes: 2

Related Questions