How to fix: unrecognized selector sent to instance
- by Matt
I am having a problem that may be simple to fix, but not simple for me to debug. I simple have a button inside a view in IB; the file's owner is set to the view controller class I am using and when making the connections, everything seems fine, ie. the connector is finding the method I am trying to call etc.
however, I am receiving this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIApplication getStarted:]: unrecognized selector sent to instance 0x3d19130'
My code is as follows:
RootViewController.h
@interface RootViewController : UIViewController {
IBOutlet UIButton* getStartedButton;
}
@property (nonatomic, retain) UIButton* getStartedButton;
- (IBAction) getStarted: (id)sender;
@end
RootViewController.m
#import "RootViewController.h"
#import "SimpleDrillDownAppDelegate.h"
@implementation RootViewController
@synthesize getStartedButton;
- (void)viewDidLoad {
[super viewDidLoad];
}
- (IBAction) getStarted: (id)sender {
NSLog(@"Button Tapped!");
//[self.view removeFromSuperview];
}
- (void)dealloc {
[getStartedButton release];
[super dealloc];
}
@end
Seems simple enough...any thoughs?