Tearing my hair here. Read a lot of examples that describe how to get around this, but no one helped me get rid of this problem.
You have a simple button on a UIView related to IBAction.
The code is ...
Contact.h
#import <UIKit/UIKit.h>
@interface Contact : UIViewController {
}
-(IBAction)buttonPressed:(id)sender;
@end
Contact.m
#import "Contact.h"
@implementation Contact
- (IBAction)buttonPressed:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Button Pressed" message:@"You pressed the button" delegate:nil cancelButtonTitle:@"Yep, I did." otherButtonTitles:nil];
[alert show];
[alert release];
}
Constantly receiving this error message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController buttonPressed:]: unrecognized selector sent to instance 0xd1d5f0'
Touch Up Inside is associated with the file owner using buttonPressed.
We downloaded another sample code, and they work fine. My project and nib are set up the same way with another sample code.
I donβt know where you can even try and debug this.
Can anybody help?
source
share