Matodobra24
Matodobra24

Reputation: 55

iPhone Simulator magneticHeading?

I have created an app that I want to know the magneticHeading. I have coded it in every way possible that I thought it would work. From there I have been testing my app on the simulator but it wont give me the magneticHeading Value.

I have looked for this before and I believe the answer is that the simulator will not give you this value. I haven't found anything that flat out said it so I just want to check with the community for my exact situation:

Will the iPhone simulator give you the magneticHeading Data.

Would it with a gpx file?

Upvotes: 1

Views: 389

Answers (1)

Bamsworld
Bamsworld

Reputation: 5680

Your assumptions are correct because the simulator does not have the required hardware, which in this case is the magnetometer. You can determine way points, routes etc with a .gpx file but as far as orienting the display to correlate with the direction the user is facing, you'll need a compass. Testing on an actual device with the required hardware would therefor be preferable.

The use of location services requires user authorization. In addition, some location services require the presence of specific hardware on the given device. For example, heading information is available only on devices that contain a hardware compass.

This is taken from CLLocationManager Class Reference

For a list of devices that have the magnetometer hardware have a look at iOS Device Compatibility Reference

Upvotes: 1

Related Questions