NSArray文件读写
1.NSArray数据写入到文件中
NSArray *arr = @[@"lnj", @"lmj", @"jjj", @"xcq"]; BOOL flag = [arr writeToFile:@"/Users/LNJ/Desktop/persons.plist" atomically:YES]; NSLog(@"%i", flag);
2.从文件中读取数据到NSArray中
NSArray *newArr = [NSArray arrayWithContentsOfFile:@"/Users/LNJ/Desktop/persons.xml"]; NSLog(@"%@", newArr);