How to fix: unrecognized selector sent to instance
Posted
by Matt
on Stack Overflow
See other posts from Stack Overflow
or by Matt
Published on 2009-10-07T17:20:07Z
Indexed on
2010/06/09
6:02 UTC
Read the original article
Hit count: 244
iphone-sdk
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?
© Stack Overflow or respective owner