0

我的 Home UIView 需要当前位置坐标,我不希望在获得这些坐标之前调用它。我怎样才能最好地做到这一点?

在这段代码中,视图在更新当前位置之前被调用:

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

        currentLocation = [[CLLocation alloc] init];
    locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    [locationManager startUpdatingLocation];

TTNavigator *navigator = [TTNavigator navigator];
            navigator.persistenceMode = TTNavigatorPersistenceModeAll;
            TTURLMap *map = navigator.URLMap;

            [map from:@"tt://HomeView" toViewController:  viewController];
            [navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://HomeView"]];
        }
4

1 回答 1

0

用户可以关闭位置服务。所以我不会那样做。而是在didFinishLaunchingWithOptions之后检查位置,这样你当前的问题就会得到解决。并添加一个屏幕供用户在位置服务关闭时打开。

于 2011-01-21T16:39:05.537 回答