I have added code for finding location, this is working on simulator but it is not working on iPhone device. I have enabled the location services but still it is not working.
-(void)firstTimeRefresh {
CLLocation *bestLocation = [[[AppDelegate getAppDelegate] locationManager] bestLocation];
if ( bestLocation != NULL) {
NSLog(@"Using Best Loaction");
[self getArray: [NSArray arrayWithObjects: [NSNumber numberWithFloat:bestLocation.coordinate.latitude],
[NSNumber numberWithFloat: bestLocation.coordinate.longitude], nil] :@"false":page_no];
}
}
try this code and its working at mine end.
Define the CLLocationManagerDelegate delegate in .h class file
when location is updated this function will get called.