Ich habe diese Unterklasse von CLLocation definiertFehler beim Setzen Eigenschaft auf CLLocation Unterklasse
MyLocation.h
@interface MyLocation: CLLocation {
NSString *datum;
NSString *ellipsoid;
}
@property(nonatomic,retain) NSString *ellipsoid;
@property(nonatomic,retain) NSString *datum;
MyLocation.m
@synthesize datum,ellipsoid;
Jetzt bekomme ich eine CLLocation Instanz durch den Ort Managerdelegierter
- (void) locationManager: (CLLocationManager *) Manager didUpdateToLocation: (CLLocation *) newLocation fromLocation: (CLLocation *) oldLocation { //self.myPosition ist ein MyLocation myPosition; self.myPosition = newLocation; [myPosition setDatum: @ "WGS 84"]; [myPosition setEllipsoid: @ "WGS 84"]; }
Wenn ich die self.myPosition = newLocation erhalte ich eine abgefangene Ausnahme und es stirbt
ich auch auf diese Weise mit gleichen Ergebnisse versucht haben:
self.myPosition = (MyLocation *)newLocation;