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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

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

openssl - Load PKCS#8 binary key into Ruby -