开发者

iPhone simulator 4.3 with xcode 4 is not showing current location

开发者 https://www.devze.com 2023-03-26 03:55 出处:网络
I have xcode 4 and iphone simulator 4.3. i have downloaded sample project from apple developer website which shows 开发者_JS百科current location. So code is absolutely OK.I have mac mini with wifi on.

I have xcode 4 and iphone simulator 4.3. i have downloaded sample project from apple developer website which shows 开发者_JS百科current location. So code is absolutely OK.I have mac mini with wifi on. I have tested that project and once it run. but after that despite of many attempts it does not show location and gives error finding location.

What will be the reason of it.


The location should be defaulting to Cupertino.

In Xcode 4.2/iOS5 beta, you can specify a location to test with for the sim.


It did the same to me: it showed the location at first, then I installed the xcode 4.2 beta, then when I went back to 4.1 location was not showing anymore and CLLocationManager was throwing an location error.

I did the following, and the problem was fix (I don't know if both actions are required or only one will suffice, because now it works and can't reproduce):

Run te simulator then:

  • unplug the network cable
  • change the device to iPhone (retina): Hardware > Device > iPhone (Retina)

I did this by mistake, and it fixed the location on my iMac.


You can't get location on simulator. So try on a device. CLLocation class is hardware specific.

0

精彩评论

暂无评论...
验证码 换一张
取 消