Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
602 views
in Technique[技术] by (71.8m points)

objective c - NSInvalidArgumentException - receiver has no segue with identifier

I have been trying everything for hours, and nothing's worked. I am trying to segue between two view controllers, from one tableViewController to another tableViewController. The segue is hooked up to the top level view, not the tableviewcell. The identifier that was set in Xcode is identical to the one used in the code (copy and pasted). It was working fine last night, but now i can't seem to get it to segue without crashing.

here are the methods in which the segue is called

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    self.photoList = [FlickrFetcher photosInPlace:[self.topPlacesList objectAtIndex:indexPath.row] maxResults:50];
    NSLog(@"photolist %@", self.photoList);

    NSLog(@"here");

    [self performSegueWithIdentifier:@"segue1" sender:self];
    NSLog(@"here");
}


-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([segue.identifier isEqualToString:@"segue1"])
    {
        PhotosTableViewController *photosTVC = segue.destinationViewController;
        photosTVC.photoList = self.photoList;
    }
}

here is the error report

2012-08-08 15:28:39.093 Top Places[512:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (PlacesTableViewController: 0x6887ff0) has no segue with identifier 'segue1'' * First throw call stack: (0x13c0052 0x1551d0a 0xde24b 0x3efd 0xa771d 0xa7952 0x92f86d 0x1394966 0x1394407 0x12f77c0 0x12f6db4 0x12f6ccb 0x12a9879 0x12a993e 0x17a9b 0x2778 0x26d5) terminate called throwing an exception

here is a screenshot of the storyboard http://s14.postimage.org/66wf13q4h/Screen_Shot_2012_08_08_at_3_22_10_PM.png

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I was able to fix it by running "clean" under the "Product" menu in Xcode, and resetting the contents and settings in the simulator.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...