Not found in protocol
Posted
by
Alex
on Stack Overflow
See other posts from Stack Overflow
or by Alex
Published on 2011-01-15T19:48:29Z
Indexed on
2011/01/15
19:53 UTC
Read the original article
Hit count: 172
I've subclassed MKAnnotation so that i can assign objects to annotations and then assign this object to a view controller like so:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
PlaceDetailView *detailView = [[PlaceDetailView alloc] initWithStyle:UITableViewStyleGrouped];
detailView.place = [view.annotation place];
[self.navigationController pushViewController:detailView animated:YES];
[detailView release];
}
This is working great but i'm having the following issues:
If i try and access the place getter method like so
view.annotation.place
i recieve an error:Accessing unknown place getter method
If i acces the place getter method like so
[view.annotation place]
i receive a warning:place not found in protocol
From my understanding this is because the place object is not defined in the MKAnnotation protocol, although i'm aware of this i'm not sure how to tell the complier that place does exist and it's not calling it blind.
© Stack Overflow or respective owner