我正在尝试更改DetailedViewController 上的文本,但每次单击单元格时都会出现此错误。任何帮助是极大的赞赏。
*由于未捕获的异常 'NSInvalidArgumentException' 导致应用程序终止,原因:'Receiver () has no segue with identifier 'MySegue''
这就是我的代码的样子。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [feedsTableView cellForRowAtIndexPath:indexPath];
[self performSegueWithIdentifier:@"MySegue" sender:indexPath];
UILabel *title = (UILabel *)[cell.contentView viewWithTag:0011];
NSLog(@"TITLE; %@", title.text);
DetailViewController *nextView=[self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController:nextView animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
}
这是我的 -prepareForSegue
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"MySegue"]) {
// Get destination view
DetailViewController *vc = [segue destinationViewController];
// Pass the information to your destination view
vc.title.text = @"lol";
}
}