简体   繁体   English

IOS4中的位置问题

[英]location problem in IOS4

i am using location in my app and tested it with IOS 3 simulatior it works fine also on device it works fie. 我在我的应用程序中使用位置,并通过IOS 3模拟器对其进行了测试,它在可以正常运行的设备上也可以正常工作。 but when tested it on IOS4 simulator it crashes..and unable to find location I know that the location on simulator is of infinite loop cupertino california. 但是,当在IOS4模拟器上对其进行测试时,它崩溃了。并且无法找到位置,我知道模拟器上的位置是加利福尼亚州无限循环的库柏蒂诺。 but it is not working in IOS4... 但它在IOS4中不起作用...

and i don't have Iphone4...So can't test further 我没有Iphone4 ...所以无法进一步测试

please help 请帮忙

Maybe the simulator can't retrieve the default CLLocationManager location. 也许模拟器无法检索默认的CLLocationManager位置。 You can try this: 您可以尝试以下方法:

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    location = newLocation.coordinate;

// Manually setting a default location for simulator only
    if(TARGET_IPHONE_SIMULATOR){
    location.latitude= 45.00;
    location.longitude= 45.00;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM