I've defined this subclass of CLLocation
MyLocation.h
@interface MyLocation: CLLocation {
NSString *datum;
NSString *ellipsoid;
}
@property(nonatomic,retain) NSString *ellipsoid;
@property(nonatomic,retain) NSString *datum;
MyLocation.m
@synthesize datum,ellipsoid;
Now i get a CLLocation instance through the location manager delegate
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ //self.myPosition is a MyLocation myPosition; self.myPosition = newLocation; [myPosition setDatum: @"WGS 84"]; [myPosition setEllipsoid: @"WGS 84"]; }
When i do the self.myPosition = newLocation i get an UNCAUGHT EXCEPTION and it dies
I've also tried this way with same results:
self.myPosition = (MyLocation *)newLocation;