Skip to content

Instantly share code, notes, and snippets.

@jcalonso
Created October 10, 2012 16:54
Show Gist options
  • Save jcalonso/3866874 to your computer and use it in GitHub Desktop.
Save jcalonso/3866874 to your computer and use it in GitHub Desktop.

Revisions

  1. jcalonso created this gist Oct 10, 2012.
    51 changes: 51 additions & 0 deletions MapAnnotation
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    #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