在iPhone OS 4.0中未调用CLLocationManager Delegate

时间:2010-07-06 06:36:49

标签: iphone objective-c cllocationmanager

我必须在iPhone OS 4.0中运行我的应用程序。 (在模拟器中)。

-(BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self newLocationUpdate];
}

-(void)newLocationUpdate
{
    locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    [locationManager startUpdatingLocation];

}

- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation 
{
    [locationManager stopUpdatingLocation];
}

在此CLLocationManager中,委托方法未被调用。我们应该做什么改变才能调用委托方法?

1 个答案:

答案 0 :(得分:3)