//获取沙盒路径
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;
}
网友评论