zoukankan      html  css  js  c++  java
  • IOS NSBundle使用(访问文件夹)

    NSBundle的相关信息

    1.一个NSBundle代表一个文件夹,利用NSBundle能访问对应的文件夹

    2.利用mainBundle就可以访问软件资源包中的任何资源

    3.模拟器应用程序的安装路径:

    /Users/aplle/资源库/Application Support/iPhone Simulator/7.1/Applications

    代码:访问plist文件

            NSString *path=[[NSBundle mainBundle]pathForResource:@"statuses.plist" ofType:nil];

    代码 :访问Xib

    +(instancetype)cellWithTableView:(UITableView *)tableView{
    
        static NSString *ID=@"tg";
        MJtgCell *cell=[tableView dequeueReusableCellWithIdentifier:ID];
        if(cell==nil)
        {
            //从xib中加载cell
            cell=[[[NSBundle mainBundle]loadNibNamed:@"MJtgCell" owner:nil options:nil]lastObject];
        }
        return cell;
        
    }
  • 相关阅读:
    k8s蓝绿
    nginx总结
    promethues监控 之 TCP连接数
    制作私有ssl证书
    redis命令
    zabbix主机自动发现
    Kubernetes各组件服务重启
    linxu下常用命令
    encodeURIComponent
    查询条件
  • 原文地址:https://www.cnblogs.com/liuwj/p/6476813.html
Copyright © 2011-2022 走看看