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 trialNehemiah Reese
17,692 PointsCancel action crashing. Any help?
#pragma mark - IBAction
- (IBAction)cancel:(id)sender {
[self reset];
[self.tabBarController setSelectedIndex:0];
}
- (IBAction)send:(id)sender {
if (self.image == nil && [self.videoFilePath length] == 0) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Oops!" message:@"Please capture a moment!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
[alertController addAction:ok];
[self presentViewController:alertController animated:YES completion:nil];
[self presentViewController:self.imagePicker animated:NO completion:nil];
} else {
[self uploadMessage];
[self.tabBarController setSelectedIndex:0];
}
}
- (void)reset {
self.image = nil;
self.videoFilePath = nil;
[self.recipients removeAllObjects];
Error msg. =
[CameraViewController Cancel:]: unrecognized selector sent to instance 0x7fca92dbecc0 Ribbit[54793:8018853] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CameraViewController Cancel:]: unrecognized selector sent to instance 0x7fca92dbecc0'
Nehemiah Reese
17,692 PointsFound the answer if anybody else has this problem. I deleted the cancel button and made another one. I changed the type to UIBarButtonItem
1 Answer
landonferrier
25,097 PointsNehemiah, here is a full template for the social network application: Click Here.
Nehemiah Reese
17,692 PointsNehemiah Reese
17,692 PointsFound the answer if anybody else has this problem. I deleted the cancel button and made another one. I changed the type to UIBarButtonItem