
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.61 KB | hits: 38 | expires: Never
NSManagedObject conform to MKAnnotation
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import <MapKit/MapKit.h>
@interface Station : NSManagedObject <MKAnnotation>
@property (nonatomic, retain) NSString * station_name;
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@end
#import "Station.h"
@implementation Station
@dynamic station_name;
@synthesize coordinate;
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate
{
coordinate = CLLocationCoordinate2DMake(newCoordinate.latitude, newCoordinate.longitude);
}
- (NSString*)title
{
return self.station_name;
}
@end