Created
October 10, 2012 16:54
-
-
Save jcalonso/3866874 to your computer and use it in GitHub Desktop.
Custom MKAnnotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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