Question

I have two UIViewController's. In the view1, i manage annotations with PINs, so i need to push the view2 exactly when the user click on the accessory control, my code is this:

-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
    NSLog(@"calloutAccessoryControlTapped");
    [self performSegueWithIdentifer:@"My identifier" sender:self];
}

When compiling, i got this warning:

Instance method '-performSegueWithIdentifer:sender:' not found (return type defaults to 'id')

And when running, the app obviously crashes with this stack:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[view1 performSegueWithIdentifer:sender:]: unrecognized selector sent to instance 0x7d94ca0'

In the storyboard, i selected the view1, ctrl+left click+ drop to view2, then i chooses push. Also, i have setted the segue identifier to My identifier. So what am i missing here?

Was it helpful?

Solution

"performSegueWithIdentifer" has a typo. There's a letter 'i' missing. Try "performSegueWithIdentifier".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top