The code you provided (assuming that you did not change anything during the insertion) is missing a function or code block to run the first part, I suggest you put it in your viewController init, for example:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { locationManager=[[CLLocationManager alloc] init]; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.delegate=self;
source share