I am using mapView with an callout from a simple annotation. I used the below delegate method
- (void)mapView:(MKMapView *)_mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
lbhProfileMapPoint *mp = (lbhProfileMapPoint *) view.annotation;
NSLog(@"mp objectID: %@", mp.objectID);
self.objectId = mp.objectID;
[[lbhVariables sharedInstance] setMapViewChosenObjectId:self.objectId];
//[self performSegueWithIdentifier:@"profileSegue" sender:self];
lbhProfileViewController *pvc = [[lbhProfileViewController alloc] init];
[pvc setObjectId:self.objectId];
[self.navigationController pushViewController:pvc animated:NO];
}
It doesn’t go to the viewcontroller but keeps saying
Unbalanced calls to begin/end appearance transitions for <lbhProfileViewController: 0x1f017ec0>.
actually the lbhProfileViewController, It’s connected within my storyboard via other viewcontrollers. But with this accessory callout, I want to manually call it. As you can see I have
//[self performSegueWithIdentifier:@"profileSegue" sender:self];
in the code, but if I use this method instead, it still gives me unbalanced calls.
If you use
performSegueWithIdentifier:sender:method you should also useprepareForSegue:sender:method. Your code inprepareForSegue:sender:method will be something like this:Also to use this, you will need a segue directly connecting to the
lbhProfileViewControllerfrom the view controller calling the map delegate method.