Return to Snippet

Revision: 25483
at March 31, 2010 10:36 by BenClayton


Initial Code
NSString *myString; //Assuume the string you want to write is this
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"myfile.txt"];
[myString writeToFile:path atomically:YES];

Initial URL

                                

Initial Description

                                

Initial Title
Write string to file in documents folder

Initial Tags

                                

Initial Language
Objective C