Finding Direction in iPhone like in Compass?

时间秒杀一切 提交于 2019-12-04 17:44:27

问题


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.

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.

Thanks in advance.


回答1:


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

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




回答2:


Here i have given you the simple PDF to get an overview about the Magnetometer, CLLocation and accelerometer functions. make a look about this.,

http://learningiphoneprogramming.com/pdf/The_Sensors_in_your_iPhone.pdf




回答3:


You can get lot of help from this link http://answers.oreilly.com/topic/1657-how-to-use-the-iphones-digital-compass/

also if you want to search it in Apple look for CLLLocationManager and UIAcelerometer. You will find the code hopefully.

Taimur.




回答4:


The iPhone 3GS has a magnetometer for detecting magnetic position, the 3G doesn't so you won't be able to do it on a 3G



来源:https://stackoverflow.com/questions/3675643/finding-direction-in-iphone-like-in-compass

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!