Hello all:
I want to add a new view on a rightcalloutaccessoryview button press. I currently have the functionality for dropping a pin on the map. A callout (MKAnnotation) with a title, subtitle, and chevron loads when I tap the pin. When I tap the chevron (rightcalloutaccessoryview) I want another view to pop up showing more information at this point. Right now, the chevron tap does nothing. This is what I have:
-(IBAction)showInfo:(id)sender
{
int calloutButtonPressed = ((UIButton *)sender).tag;
if(calloutButtonPressed < 99999)
{
if(self.DetailView == nil)
{
DetailViewController *tmpViewController = [[UIViewController alloc] initWithNibName:@"DetailView" bundle:nil];
self.DetailView = tmpViewController;
[tmpViewController release];
}
if (calloutButtonPressed == 1)
{
// Using the debugger, I found that calloutButtonPressed is equal to 0 when the button is pressed.
// So I'm not sure what the point of this method is...
}
self.DetailView.title = @"Title";
}
}
I have verified that this action method does get called upon pressing the chevron. Unfortunately, I can't get it to pull up a new view. If anyone knows what I'm doing wrong, please let me know. I'm in a bit of a pinch...
Thanks!
Thomas