• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Copying CLHeading objects does not appear to work . . .
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying CLHeading objects does not appear to work . . .


  • Subject: Re: Copying CLHeading objects does not appear to work . . .
  • From: "Michael A. Crawford" <email@hidden>
  • Date: Thu, 11 Feb 2010 11:51:00 -0500

It the copy failing because these are read-only properties?

-Michael

On Feb 11, 2010, at 11:29 AM, Michael A. Crawford wrote:

> 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

_______________________________________________

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

References: 
 >Copying CLHeading objects does not appear to work . . . (From: "Michael A. Crawford" <email@hidden>)

  • Prev by Date: Re: iPhone and OS X apps question
  • Next by Date: Re: What classes have -init?
  • Previous by thread: Copying CLHeading objects does not appear to work . . .
  • Next by thread: iPhone and OS X apps question
  • Index(es):
    • Date
    • Thread