iphone - how to retrieve magnetic value from CLHeading -


i'm trying clheading compass value,

- (void)locationmanager:(cllocationmanager *)manager didupdateheading:(clheading *)newheading {  if (curheading != nil)   [curheading release];   curheading = newheading;  nslog(@"%@",curheading);  [curheading retain]; } 

the above give result -

magneticheading 89.00 trueheading +103.27 accuracy 5.00 x +1.375 y +41.875 z +37.438 @ 2010-01-18 10:18:37 +0800

but need magneticheading value,

i alter code :

a)

newheading.magneticheading -> got result null

b)

newheading.trueheading -> program received signal: “exc_bad_access”.

can help, trying other possible way compass value.

magneticheading , trueheading both of type cllocationdirection, double. if want nslog() double, have use "%f", or "%.9f", not "%@", objects.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -