Xcode CLLocationManager startUpdatingLocation不在应用程序中工作:didFinishLaunchingWithOptions:

Xcode CLLocationManager startUpdatingLocation不在应用程序中工作:didFinishLaunchingWithOptions:,xcode,ios6,cllocationmanager,Xcode,Ios6,Cllocationmanager,我在AppDelegate的方法应用程序中使用CLLocationManager startUpdatingLocation:didFinishLaunchingWithOptions: 委托方法永远不会被激发 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [self performSelectorO

我在AppDelegate的方法应用程序中使用CLLocationManager startUpdatingLocation:didFinishLaunchingWithOptions: 委托方法永远不会被激发

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  ...

    [self performSelectorOnMainThread:@selector(startUpdatingLocation) withObject:nil waitUntilDone:NO];

//    [self startUpdatingLocation];

    return YES;
}

-(void)startUpdatingLocation
{
    locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    [locationManager startUpdatingLocation];
}
我已经尝试了这两种方法,使用主线程和调用我的方法,但它们都不起作用

我已经实现了所有这些方法,但都没有触发:

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
解决方案:

https://devforums.apple.com/message/1073496#1073496

在哪里编写委托方法?在AppDelegate本身中