Whenever I write to a file (using methods such as `NSArray writeToFile:atomically:”, I first use:
NSString* rootDir=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString* fileName=[rootDir stringByAppendingPathComponent: @"my_file_name"];
Where is the file written to if I just write to @"my_file_name" instead?
It would be written into your application folder, but , in this case,
NSArray writeToFile:atomically:will returnNOas you won’t have permission to write there