开发者

check wheather gps is available or not in iphone

开发者 https://www.devze.com 2023-01-16 21:25 出处:网络
hi i am making an app based on gps... i have tested it and working fine in iphone simulator 3.0.. but when gps is not available i want to generate an alert...(i just remove the internet connection)

hi i am making an app based on gps... i have tested it and working fine in iphone simulator 3.0..

but when gps is not available i want to generate an alert...(i just remove the internet connection) i used following method but did not work....

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {

    NSLog(@"Error: %@", [error开发者_高级运维 description]);

    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error getting Current Location" message:@"Please check your Internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    [alertView show];
    [alertView release];

}

so please tell me how to do that (currently working iphone 3.0)

and please also tell if i shift this app.to iphone 4 will it work...asking because i have listen that iphone 4 has gps problem... for this i tried this on simulator 4.0...but it failed...


The GPS on the iphone, or any device for that matter, does not depend having an internet connection.

0

精彩评论

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