Wednesday, 30 April 2014

Creating file in NSTemporary​Directory

NSString *fileName = @"sample.txt";
NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:fileName];
NSString *contentsOfFile = @"Sample text.";
NSData *data =  [contentsOfFile dataUsingEncoding:NSUTF8StringEncoding];
[data writeToFile:path atomically:YES];

No comments:

Post a Comment