如果我使用的是故事板并且入口点是 viewController1。
有没有办法让 App Delegate 运行条件然后选择情节提要入口点 - viewController1 或 viewController2?
我想从 App Delegate 中选择是否打开位置服务,然后执行以下操作:
(![CLLocationManager locationServicesEnabled])
{
self.viewController = [[viewController1 alloc] init];
NSLog(@"vc is viewController2 from app del. loc svcs off");
}
else if ([CLLocationManager locationServicesEnabled])
{
// alert location services denied
self.viewController = [[viewController2 alloc] init];
NSLog(@"vc is viewController2 from app del. loc svcs on");
NSLog(@"core location is on");
}