Custom MKAnnotation
#import <Foundation/Foundation.h> | |
#import <MapKit/MKAnnotation.h> | |
@interface MapAnnotation : NSObject <MKAnnotation> { | |
@public | |
CLLocationCoordinate2D coordinate; | |
NSString *title; | |
NSString *subtitle; | |
NSDictionary *placeData; | |
NSObject *object; | |
BOOL isPerson; | |
} | |
@property BOOL isPerson; | |
@property (nonatomic, readwrite, assign) CLLocationCoordinate2D coordinate; | |
@property (nonatomic, copy) NSString *title; | |
@property (nonatomic, copy) NSString *subtitle; | |
@property (nonatomic, copy) NSDictionary *placeData; | |
@property (nonatomic, strong) NSObject *object; | |
- (id) initWithTitle:(NSString *)theTitle | |
subtitle:(NSString *)theSubtitle | |
coordinate:(CLLocationCoordinate2D)theCoordinate | |
isPerson:(BOOL)ifItsPerson | |
placeData: (NSDictionary *) thePlaceData; | |
@end | |
------ | |
#import "MapAnnotation.h" | |
@implementation MapAnnotation | |
@synthesize coordinate, title, subtitle, object,placeData,isPerson; | |
- (id) initWithTitle:(NSString *)theTitle | |
subtitle:(NSString *)theSubtitle | |
coordinate:(CLLocationCoordinate2D)theCoordinate | |
isPerson:(BOOL)ifItsPerson | |
placeData: (NSDictionary *) thePlaceData{ | |
if (self = [super init]) { | |
self.title = theTitle; | |
self.subtitle = theSubtitle; | |
self.coordinate = theCoordinate; | |
self.placeData = thePlaceData; | |
self.isPerson = ifItsPerson; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment