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. 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. but it is not working in IOS4...
and i don't have Iphone4...So can't test further
please help
Maybe the simulator can't retrieve the default CLLocationManager location. 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;
}
}
精彩评论