Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pankaj21c

macrumors newbie
Original poster
Apr 15, 2009
14
0
Hi All,

In my application i am using Corelocation to get the current location.
In this viewWillAppear i am calling this method
-(void)getCurrentLocation {
CLController = [[CoreLocationController alloc] init];
CLController.delegate = self;
[CLController.locMgr startUpdatingLocation];
}
to get the location. Now one default alert shows “would you like to use current location" . Everything works fine if i allow to access location. But if i select don’t allow and then if i click on the refreshLocation button and calling the below method
-(void)refreshLocation {
[CLController.locMgr stopUpdatingLocation];
[CLController.locMgr startUpdatingLocation];

} it always goes to - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
}

Please tell me whats the reason..Any sample code would be great.
Thanks in advance
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.