Эй, ребята, я пытаюсь вызвать метод обновления, но он не работает, любая идея?
#import "TrackerViewController.h"
@implementation TrackerViewController
-(IBAction)updateButton:(id)sender{
[self update];
}
-(void)update{
locmanager = [[CLLocationManager alloc] init];
[locmanager setDelegate:self];
[locmanager setDesiredAccuracy:kCLLocationAccuracyBest];
[locmanager startUpdatingLocation];
}
-(void)viewDidLoad {
[self update];
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
CLLocationCoordinate2D loc = [newLocation coordinate];
latitude.text = [NSString stringWithFormat: @"%f", loc.latitude];
longtitude.text = [NSString stringWithFormat: @"%f", loc.longitude];
}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
}