像在Compass中一样在iPhone中寻找方向?

问题描述:

有没有人有想法使用iPhone找到真正的方向?我想实现这样的应用程序,其中我需要找到iPhone指向的方向,并希望使应用程序与iphone 3GS中的指南针应用程序相同。

Do any one have idea for finding true direction using iPhone? I want to implement such application in which I need to find direction in which iPhone is pointing and want to make application same as compass application in iphone 3GS.

iPhone 3G是否支持指南针功能?并且任何人都可以告诉我罗盘应用程序如何像真正的磁罗盘那样准确地找到方向吗?

Does iPhone 3G supports compass functionality? And can any one tell me how compass application find directions so accurately like a real magnetic compass?

请帮助我。我处于危急情况。

Please help me for this. I am in a critical situation.

提前致谢。

这里是apple.com的示例代码链接,用于使用磁力计和核心位置
https://developer.apple.com/library/ios/#samplecode/Teslameter/Introduction/Intro.html

here is a sample code link from apple.com for using magnetometer and Core Location https://developer.apple.com/library/ios/#samplecode/Teslameter/Introduction/Intro.html

您需要登录,以防您无法找到该页面,只需在 https://developer.apple.com

you need to be logged in, in case you cant find the page, just look for Teslameter example in Sample Code section of https://developer.apple.com