标签:
1.利用从特定的路径中取出字典的返回BOOL值来进行判断。
//获取plist文件的地址,为空
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/d.plist"];
//根据文件创建字典
NSDictionary *dic = [NSDictionary dictionaryWithContentsOfFile:path];
//取出字典的值,这里没有,为false
BOOL isorNO = [[dic objectForKey:@"Nofiasrt"] boolValue];
if(isorNO){
ViewController *viewController = [[ViewController alloc] init];
self.window.rootViewController = viewController;//非启动界面的进入
}else{
FViewController *viewController = [[FViewController alloc] init];
self.window.rootViewController = viewController;//启动界面的进入
//创建可变字典存入值为YES
NSMutableDictionary *d = [NSMutableDictionary dictionary];
[d setObject:@"YES" forKey:@"Nofiasrt"];
//把字典放到路径中,方便运行时取出数据
[d writeToFile:path atomically:YES];
}
标签:
原文地址:http://www.cnblogs.com/LMML/p/5796995.html