tags:

views:

50

answers:

1

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...

+2  A: 

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

toxaq
ok! thanks for information....i think you missed my original question
Ranjeet Sajwan
Well you'll need to reframe your question. The title seemed reasonably obvious "check wheather gps is available or not in iphone". The GPS is always "available" if the device has GPS, whether or not it's accurate is another question.
toxaq