Create .h File
@interface MapPinClass : NSObject <MKAnnotation>{ CLLocationCoordinate2D coordinate; NSString *title; NSString *subtitle,*color,*index,*locationId;
}
@property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *subtitle,*color,*index,*locationId;
Create .m file
@implementation MapPinClass @synthesize coordinate,title,subtitle,color,index,locationId; -(void)dealloc{ [title release]; [super dealloc];
}
write the code in which you installed
MapPinClass *ann = [[MapPinClass alloc] init]; ann.title = AppMain.Heading; ann.subtitle = AppMain.Detail; ann.coordinate = region.center; [myMapView addAnnotation:ann];
source share