关于info.plist

来源:互联网 发布:linux mv 创建目录 编辑:程序博客网 时间:2024/05/17 01:09
#判断是否首次安装应用
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];      NSString *key = (NSString *)kCFBundleVersionKey;    // 1.从Info.plist中取出版本号  NSString *version = [NSBundle mainBundle].infoDictionary[key];    // 2.从沙盒中取出上次存储的版本号  NSString *saveVersion = [[NSUserDefaults standardUserDefaults] objectForKey:key];    if ([version isEqualToString:saveVersion]) { // 不是第一次使用这个版本    // 显示状态栏    application.statusBarHidden = NO;        self.window.rootViewController = [[MainController alloc] init];  } else { // 版本号不一样:第一次使用新版本    // 将新版本号写入沙盒    [[NSUserDefaults standardUserDefaults] setObject:version forKey:key];    [[NSUserDefaults standardUserDefaults] synchronize];        // 显示版本新特性界面    self.window.rootViewController = [[NewfeatureController alloc] init];  }    [self.window makeKeyAndVisible];  return YES;}
#其他关于info.plist
0 0
原创粉丝点击