NSArray读写文件在Xcode中创建成功,但没有在控制台打印写入成功,估计是桌面路径的问题?如何显示正确的桌面路径信息呢?请高手指点,谢谢!
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSArray *arr = [NSArray arrayWithObjects:
@"one",@"rina",@"jenny",@"68",@"delin",@"mama",nil];
//arr.plist是一种特殊的文件格式
BOOL isWrite = [arr writeToFile:@"/users/Desktop/arr.plist"atomically:YES];
if(isWrite){
NSLog(@"写入成功");
}
}
return 0;
}
|
|