I have a navigation controller that has a segue links between them called "addSegue". When I click on the tableView
cell though the app crashes and I get the error below:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<MSAddFriendsViewController: 0x98cc340>) has no segue with identifier 'addSegue'
I don't think that I have any issues with my code. Here is the method in which I have the line showSegueWithIdentifier
:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSMutableSet *selectedUsers = [NSMutableSet set];
[self.tableView deselectRowAtIndexPath:indexPath animated:NO];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryCheckmark;
PFRelation *friendsRelation = [self.currentUser relationforKey:@"friendsRelation"];
PFUser *user = [self.allUsers objectAtIndex:indexPath.row];
[friendsRelation addObject:user];
[self.currentUser saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (error) {
NSLog(@"Error %@ %@", error, [error userInfo]);
} }];
[self performSegueWithIdentifier:@"addSegue" sender:self];
}
I had this same problem and actually my problem was that I was calling
WRONG: [self.navigationController performSegueWithIdentifier:@"ShowVerify" sender:self];
instead of
CORRECT: [self performSegueWithIdentifier:@"ShowVerify" sender:self];
so check that you are calling correct performSegueWithIdentifier method :)