Reputation: 18488
I am aware there is now a way to simulate location, but is there a way to simulate compass values?.
Upvotes: 11
Views: 6146
Reputation: 39306
Compass is not in the list of the hardware interactions supported by the simulator and CLLocationManager headingAvailable reports it's not available on the simulator.
Also, in this doc:
Some location services require the presence of specific hardware on the given device. For example, heading information is available only for devices that contain a hardware compass. This class defines several methods that you can use to determine which services are currently available.
Specifically 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
Upvotes: 12