Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Shaun Kelly
5,648 PointsMy app crashes as soon as i press the button...
App crashes when i press the button and says in the log "unrecognized selector sent to instance"
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self.aButton setTitle:@"Press me!" forState:UIControlStateNormal];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)buttonPressed {
self.view.backgroundColor = [UIColor orangeColor];
}
@end
3 Answers

Meek D
3,457 PointsYou need to connect the function to the UIButton

Shaun Kelly
5,648 PointsI have already

Meek D
3,457 Pointsdelete the button then redo it again

Alex Robertson
4,976 PointsI am also getting this error. I'm pretty sure I followed the video exactly. What do you mean "connect the function to the UIButton"?
Chris Jackson
30,535 PointsChris Jackson
30,535 PointsI'm having the same problem. My code is exactly the same. Has anyone found a solution?