zoukankan      html  css  js  c++  java
  • 切换根控制器UIApplication 主屏幕UIScreen 读取文件资源NSBundle

    
    
    1 //主屏幕设为webView
    2 CGRect frame = [UIScreen mainScreen].applicationFrame;
    3 UIWebView *webView = [[[UIWebView alloc] initWithFrame:frame] autorelease];
    4 self.view = webView;
    
    
    
    1 UIApplication *app = [UIApplication sharedApplication];
    2 // 显示状态栏
    3  app.statusBarHidden = NO;
    4 ChangeController *index = [[ChangeController alloc] init];
    5 // 设置窗口的根控制器
    6 app.keyWindow.rootViewController = index;
    7 [index release];
    1 //回到根控制器
    2 popToRootViewControllerAnimationed:YES
    3 //返回
    4 popViewControllerAnimated


     

      id key = (id)kCFBundleVersionKey;
    1
    // 检测是否第一次使用这个版本 info.plist 2 NSDictionary *info = [NSBundle mainBundle].infoDictionary; 3 NSString *currentVersion = [info objectForKey:key]; 4 5 // 从沙盒中取出版本号 6 NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults]; 7 NSString *saveVersion = [defaults objectForKey:key];
    1 //获取图片
    2  NSString *path = [[NSBuddle mainBuddle] pathForResource:@"resourceName" oftype@"plist"];
    3 UIImage *image = [[UIImage imageWithContentsOfFile:path];
    4 UIImage *image = [UIImage imageNamed:@"imageName"];
    5 
    6 //获取plist文件
    7 NSArray *array =[[NSArrayalloc] initWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"name" ofType:@"plist"]];
    8 NSDictionary *dict=[array objectAtIndex:index];
     
     
     
     
     
  • 相关阅读:
    驱动模块的加载与卸载
    设备驱动操作函数
    Ubuntu驱动程序开发5-根文件系统构建
    Ubuntu驱动程序开发4-内核移植和配置
    Ubuntu驱动程序开发3-Uboot移植和配置
    bootargs环境变量解析
    Shell脚本(2)
    Shell脚本(1)
    Linux环境变量
    Linux系统中ps -l命令显示的英文含义
  • 原文地址:https://www.cnblogs.com/wangshengl9263/p/3231650.html
Copyright © 2011-2022 走看看