【发布时间】:2014-01-10 00:21:04
【问题描述】:
我有一个导航控制器,它们之间有一个名为“addSegue”的 segue 链接。当我点击 tableView 单元格时,虽然应用程序崩溃了,但我收到以下错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<MSAddFriendsViewController: 0x98cc340>) has no segue with identifier 'addSegue'
我认为我的代码没有任何问题。这是我有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];
}
【问题讨论】:
-
检查您在 Storyboard 中提供的 Segue 标识符。
-
清理项目并重试。
-
您应该将您的故事板的图片发布到不需要他人许可的网站上。
标签: ios objective-c iphone swift uistoryboardsegue