zoukankan      html  css  js  c++  java
  • 关于ios项目沙盒中的文件和Xcode项目创建的文件

     //1.1获取在Xcode项目打开的情况下创建的Plist文件
     NSString *path = [[NSBundle mainBundle]pathForResource:@"ProfessionClassify" ofType:@"plist"];
    
     //1.2定义数组接收文件
     NSMutableArray *tempArray = [NSMutableArray arrayWithContentsOfFile:path];
    
     //2.1获取ios项目沙盒中的Plist文件(在项目中通过代码创建的Plist文件)
     NSString *documentDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
     NSString *selectedPath = [documentDirectory stringByAppendingPathComponent:@"Profession.plist"];

    //2.2定义数组接收文件
    NSMutableArray *selectedPathArray = [NSMutableArrayarrayWithContentsOfFile:selectedPath];

    这两个是不同路径下的文件,互不相同,互不干扰。

  • 相关阅读:
    Linux运维相关命令
    Linux常用命令合集
    python爬虫
    Linux常见知识点
    mysql linux上安装使用
    非托管代码方面的问题
    有趣知识
    C# 模式匹配
    C# 泛型约束
    怎么查看自己电脑的IP地址?
  • 原文地址:https://www.cnblogs.com/hw140430/p/3749053.html
Copyright © 2011-2022 走看看