所以我必須創建一個類X如下:annotationView代表和MKAnnotation
@interface X : NSObject <MKAnnotation> {
CLLocationCoordinate2D coordinate;
NSString * title;
NSString * subtitle;
UIImage * image;
NSInteger * tag;
}
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSString * subtitle;
@property (nonatomic, retain) UIImage * image;
@property (nonatomic, readwrite) NSInteger * tag;
@end
裏面的:
- (無效)的MapView:(的MKMapView *)的MapView annotationView:(MKAnnotationView *)視圖calloutAccessoryControlTapped :(UIControl *)控件
我希望能夠訪問X所擁有的標籤屬性。這怎麼可能? 我可以做[控制標籤]嗎?這是如何工作的?
我不明白我是如何做不正確的,我只是初始化對象X然後做了一個X.tag = 2; – aherlambang 2011-02-02 02:01:11