我的 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"]];
}