rightcalloutaccessoryview ボタンを押して、新しいビューを追加したいと考えています。現在、マップ上にピンをドロップする機能があります。ピンをタップすると、タイトル、サブタイトル、シェブロンを含む吹き出し (MKAnnotation) が読み込まれます。シェブロン (rightcalloutaccessoryview) をタップすると、この時点で詳細情報を表示する別のビューがポップアップ表示されます。現在、シェブロンタップは何もしません。これは私が持っているものです:
-(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";
}
}
シェブロンを押すと、このアクション メソッドが呼び出されることを確認しました。残念ながら、新しいビューを表示することはできません。誰かが私が間違っていることを知っているなら、私に知らせてください。ちょっとピンチで…
ありがとう!
トーマス