0

I'm trying to change the text on the DetailedViewController but every time I click on the cell I get this error. Any help is greatly appreciated.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'MySegue''

This is how my code looks like.

- (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];
}

This is my -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";
    }
}
IamGretar
  • 71
  • 9

2 Answers2

0

Are you sure you have a segue with that identifier in the storyboard? Check your storyboard.

soryngod
  • 1,827
  • 1
  • 14
  • 13
  • Of course i clicked on it , the picture isn't loading , I'll try with a different browser, don't you i would know what to do... – soryngod Jul 06 '13 at 15:37
  • Why are you using `indexPath` as a sender to the segue? – soryngod Jul 06 '13 at 15:45
  • What should I use as a sender ? – IamGretar Jul 06 '13 at 19:29
  • I got this error 2013-07-06 19:48:20.396 Social App[68937:14003] -[UILabel copyWithZone:]: unrecognized selector sent to instance 0xa0aab50 2013-07-06 19:48:20.411 Social App[68937:14003] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UILabel copyWithZone:]: unrecognized selector sent to instance 0xa0aab50' – IamGretar Jul 06 '13 at 19:47
  • Check the `DetailViewController` for that. And now I noticed , why are you performing a `segue` and immediately you push a `viewcontroller`? – soryngod Jul 06 '13 at 19:50
  • Yes I got it working but I'm wondering how would I transfer the title.text into DetailedView ? – IamGretar Jul 06 '13 at 19:54
  • use `NSNotificationCenter` with a `NSDictionary` as parameter that has the `title.text` as object. – soryngod Jul 06 '13 at 20:02
  • I responded in this post [send with NSNotificationCenter](http://stackoverflow.com/questions/17479737/didselectrowatindexpath-not-working-with-nsnotificationcenter/17483720#17483720) – soryngod Jul 06 '13 at 20:04
  • Check this out http://stackoverflow.com/questions/17506591/label-not-changing-with-segue – IamGretar Jul 06 '13 at 20:04
0

In my case:

Tapping a UITableViewCell would fail to perform the storyboard segue.

tl;dr - Forgot to change default "reuse identifier" in dequeCell..

My segues were fine. The destination view controller happened to also be a tableView controller, and I had not changed the boilerplated "reuse identifier". Preparing for segue (loading the destinationVC) would fail, silently, and so no segue would be called; it only LOOKED like a segue failure.

Hope it helps someone, somewhere, beneath the great blue sky...

Community
  • 1
  • 1
AmitaiB
  • 1,656
  • 1
  • 19
  • 19