i want to write a string in a file \"file.txt\": this file in my project (for Iphone) is inside Resources; I try to write a string in this file but it don\'t work, I show my cod
This changed with XCode 6 and iOS 6 and this got tricky.
The documents directory are now hidden within:
~/Library/Developer/CoreSimulator/Devices//data/Containers/Data/Application/
It seems the location is changing at each application start, so it's really hard to track. There is a simple tip I borrowed from this article and that I will include for the lazy ones:
#if TARGET_IPHONE_SIMULATOR
// where are you?
NSLog(@"Documents Directory: %@", [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);
#endif
Add this for example to your applicationDidFinishLaunching
method, should make it easier!
If you want more details, just have a look to the original article
NB: I know the question is old, but well, I found it while searching, so I think adding an updated answer may serve some of us!