Biranchi
Biranchi

Reputation: 16317

Creating files in Objective-C

Which one of these 2 cases is faster in creating files?

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.

Upvotes: 7

Views: 3044

Answers (1)

Rajavanya Subramaniyan
Rajavanya Subramaniyan

Reputation: 2155

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

Use any of the above

Upvotes: 7

Related Questions