1
votes

I have a simple tabbar app

I have created a XIB file and assigned it to a tab, and when I touch the tab, it accurately switches

I added a simple IBAction

in Tab1.h -(IBAction)pleasebeep:(id)sender;

in Tab1.m

-(IBAction)pleasebeep:(id)sender 
{
    NSLog(@"honk");
}

In interface builder I have created a button and linked it to the Owner and action "pleasebeep"

It compiles and launches.

When I click the button, the app crashes and I get a "-[UIViewController pleasebeep:]: unrecognized selector sent to instance 0x7b975c0 2011-10-06 04:32:25.648 FirstProject[8029:11903] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController pleasebeep:]: unrecognized selector sent to instance 0x7b975c0' * First throw call stack: (0x12de082 0x146fd0a 0x12dfd1d 0x1244f70 0x1244d52 0x12dfef9 0x37c542 0x37c4da 0x421576 0x421a3f 0x420cfe 0x3a1810 0x3a1a36 0x388234 0x37ba29 0x1ece10d 0x12b21f5 0x12170a2 0x121598a 0x1214e34 0x1214d4b 0x1ecc9dd 0x1eccaa2 0x379a1b 0x2749 0x26c5) terminate called throwing an exceptionCurrent language: auto; currently objective-c"

Any idea where to hunt for the problem?

1

1 Answers

1
votes

Have you set the right Custom Class to the File's Owner? Maybe it's still set to the default class 'UIViewController'