문제

What is the difference between "UIAccelerometer" and "CLLocationManager"? Both give me x, y and z axis as result.

UIAccelerometer

  • X -18.000
  • Y -03.500
  • Z -41.000

CLLocationManager

  • X -0.036
  • Y -0.002
  • Z -1.069

Is this information from the same sensors with different formatting? Or are there "real" differences?

Thanks!

도움이 되었습니까?

해결책

UIAccelerometer tells you which way — and how hard — gravity is pulling (including acceleration due to motion, which, per Einstein's general theory of relativity, is indistinguishable from gravity).

CLLocationManager tells you where you are on the surface of the earth. It's the GPS API.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top