up vote 0 down vote favorite

Hi all,

Which is the faster way of 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

flag

74% accept rate
The best way to find out is to test it yourself. That said, the second one (with contents:nil) makes more sense. – jtbandes Nov 16 '09 at 6:02

1 Answer

up vote 2 down vote accepted

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

link|flag

Your Answer

get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.