The segue is not performing the push action [closed]
-
03-12-2019 - |
Pregunta
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?
Solución
"performSegueWithIdentifer" has a typo. There's a letter 'i' missing. Try "performSegueWithIdentifier".
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow