[英]Creating files in Objective-C
Which one of these 2 cases is faster in creating files? 这2个案例中哪一个在创建文件方面更快?
Case 1:
======
NSData *data = [Some data];
[data writeToFile:filePath atomically:YES];
Case 2:
=======
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager createFileAtPath:filePath contents:data attributes:nil];
Thanks Biranchi. 谢谢Biranchi。
Why are you worrying about this... Are you going to be writing data frequently.. at like 60 FPS ?.. or 60 SPS (Saves per second) :D 你为什么担心这个......你是不是经常写数据...就像60 FPS?或60 SPS(每秒节省):D
Use any of the above 使用以上任何一种
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.