Copying CLHeading objects does not appear to work . . .
Copying CLHeading objects does not appear to work . . .
- Subject: Copying CLHeading objects does not appear to work . . .
- From: "Michael A. Crawford" <email@hidden>
- Date: Thu, 11 Feb 2010 11:29:18 -0500
Here is the code (pertinent snippets)
@interface BlueSLRGPS ()
@property (copy) CLHeading* currentHeading;
@property (copy) CLLocation* currentLocation;
@property (retain) CLLocation* previousLocation;
- (NSString*)compassPointForHeading:(double)heading;
- (void)locationManager:(CLLocationManager*)manager
didUpdateHeading:(CLHeading*)newHeading;
- (void)locationManager:(CLLocationManager*)manager
didUpdateToLocation:(CLLocation*)newLocation
fromLocation:(CLLocation*)oldLocation;
- (void)locationManager:(CLLocationManager*)manager
didFailWithError:(NSError*)error;
@end
@synthesize currentHeading;
- (void)locationManager:(CLLocationManager*)manager
didUpdateHeading:(CLHeading*)newHeading
{
MCLog(@"heading update isMainThread = %d", [NSThread isMainThread]);
MCLog(@"Heading: %f", newHeading.magneticHeading);
self.currentHeading = newHeading;
[self.delegate headingUpdated];
}
Here is the result.
(gdb) p newHeading
$1 = (CLHeading *) 0x481ef50
(gdb) p currentHeading
$2 = (CLHeading *) 0x3c193c0
(gdb) po (CLHeading*)0x481ef50
magneticHeading 211.00 trueHeading 205.17 accuracy 35.00 x 2.625 y -6.875 z -18.250 @ 2010-02-11 11:18:29 AM
(gdb) po (CLHeading*)0x3c193c0
magneticHeading 0.00 trueHeading 0.00 accuracy 0.00 x 0.000 y 0.000 z 0.000 @ (null)
I didn't see anything in the docs about CLHeading objects not being copyable. Any ideas as to why the copy did not duplicate the current values?
-Michael
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden