I have text file text.txt
in my xcode project and I need to write NSString init from my iOS app. I've tried this code
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDir = [paths objectAtIndex: 0];
NSString *docFile = [docDir stringByAppendingPathComponent: @"text.txt"];
NSString *content = @"Test";
[content writeToFile: docFile atomically: NO];
But it doesn't work for me... So can you help me with it?