2012-05-18 20 views
0

我正在開發一個新的應用程序。我也使用MapKitView並刪除一些引腳。 我採取了一個ID陣列,但我不能分別訪問該引腳的ID,你能幫我嗎? 在此先感謝...如何使用calloutAccessoryControlTapped:方法將數組值發送到下一個視圖?

+0

發佈一些代碼。 – iMash

+0

你想做什麼?你有什麼嘗試? – Maulik

+0

你應該發佈代碼並指出確切難度在哪裏。我不推薦已經提出的「標籤」方法。爲了更好的選擇,請參閱http://stackoverflow.com/questions/4565197/how-to-find-which-annotation-send-showdetails,http://stackoverflow.com/questions/8256288/how-to-pass-sender -tag-in-detailview-to-get-default-map-application-for-directio,http://stackoverflow.com/questions/9876042/annotation-details-after-detail-disclosure-pressed,http:// stackoverflow .com/questions/5939223/store-data-in-mkannotation等 – Anna

回答

0

因此,您必須設置標籤屬性與引腳。當標註確實選擇了方法調用然後retrive標籤fron引腳並且通過標籤從數組中獲得值並將其發送到另一個類

UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; 

rightButton.tag = annotationIndex; 

[rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; 

pinView.rightCalloutAccessoryView = rightButton; 
+0

你能解釋一下嗎?你能給我一個示例代碼來理解它.. – Piyush

相關問題