IOS simulator and Xcode to simulate a compass?

I know there is now a way to simulate a location, but is there a way to simulate a compass value ?.

+7
source share
1 answer

The compass is not included in the list of hardware interactions supported by the simulator, and the CLLocationManager header. Available reports are not available on the simulator.

Also in this document:

http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

Some location services require certain equipment on this unit. For example, header information is only available for devices that contain a hardware compass. This class defines several methods that you can use to determine which services are currently running.

In particular, the CLLocationManager has this class property to check if the compass is available:

+ (BOOL)headingAvailable 

If I run this under the simulator:

 NSLog(@"headingAvailable: %d", (int)[CLLocationManager headingAvailable]); 

Outputs:

 2011-11-08 22:38:26.873 Craplet[39975:b603] headingAvailable: 0 
+7
source

All Articles