iPhone simulator 4.3 with xcode 4 is not showing c

2019-09-15 14:16发布

I have xcode 4 and iphone simulator 4.3. i have downloaded sample project from apple developer website which shows 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.

3条回答
够拽才男人
2楼-- · 2019-09-15 14:43

The location should be defaulting to Cupertino.

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

查看更多
可以哭但决不认输i
3楼-- · 2019-09-15 14:47

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.

查看更多
Viruses.
4楼-- · 2019-09-15 14:52

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

查看更多
登录 后发表回答