Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.61 KB  |  hits: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. NSManagedObject conform to MKAnnotation
  2. #import <Foundation/Foundation.h>
  3. #import <CoreData/CoreData.h>
  4. #import <MapKit/MapKit.h>
  5.  
  6. @interface Station : NSManagedObject <MKAnnotation>
  7. @property (nonatomic, retain) NSString * station_name;
  8. @property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
  9. @end
  10.        
  11. #import "Station.h"
  12.  
  13.  
  14. @implementation Station
  15.  
  16. @dynamic station_name;
  17. @synthesize coordinate;
  18. - (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate
  19. {
  20.     coordinate = CLLocationCoordinate2DMake(newCoordinate.latitude, newCoordinate.longitude);
  21. }
  22. - (NSString*)title
  23. {
  24.     return self.station_name;
  25. }
  26. @end