关于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];

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

上一篇:挑战10个最难的Java面试题(附答案)【上】


下一篇:【HDOJ】2045 不容易系列之(3)—— LELE的RPG难题