修改默认启动VC
2016-08-26 本文已影响22人
玉米地里种玉米
//获取沙盒路径
NSString *doc = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *filePath = [doc stringByAppendingPathComponent:@"account.plist"];
NSDictionary *account = [NSDictionary dictionaryWithContentsOfFile:filePath];
//如果沙盒中没有已经存好的accessToken
//则根视图加载为 授权页
//有,则使用默认的启动页,也就是那个mainVC
// 修改默认的启动vc
if (account == nil) {
ViewController *vc = [self.window.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"oauthVC"];
self.window.rootViewController=vc;
}