09-30(初次使用软件时的登录界面的开发逻辑)

在    AppDelegate.m    文件中:

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

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

[self.window makeKeyAndVisible];

//1.取出已存的账号,判断是否过期,是否仍然正确之类

BOAccount *account = [BOAccountTool readAccount];

if (account) {

HomeViewController *homeVC = [[HomeViewController alloc] init];

self.window.rootViewController = homeVC;

}else{//2.如果不存在,登陆

LoginViewController *loginVC = [[LoginViewController alloc] init];

self.window.rootViewController = loginVC;

}

return YES;

}

你可能感兴趣的:(09-30(初次使用软件时的登录界面的开发逻辑))