I’m using Xcode 5.0.2 and iPhone Simulator 7.03.
Something doesn’t seem to be working with the the datePath() function, in that it returns a directory which does not exist. That is, the code:
NSArray *pathList = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES);
NSLog(@"%@", [pathList objectAtIndex:0]);
return [[pathList objectAtIndex:0] stringByAppendingPathComponent:@"data.td"];
logs this: —> DocPath: /Users/david/Library/Application Support/iPhone Simulator/7.0.3/Applications/84F8396F-88CF-4A56-AA68-6E497DA457C6/Library/Documentation
That path doesn’t exist on my Mac. The real file structure has […]/Library/Library/Documentation and at no point is a data.td file created in it, and so of course there is no persistence of data once the simulator is closed.
I know the rest of the code works, because if I change docPath() to @"/tmp/data.td" the data.td file is created and persists over a rebuild/rerun of the program.
The documentation for NSSearchPathForDirectoriesInDomains says that the directory returned might not exist – but why does it seem to work for other posters and not for my configuration? Is this simply a matter of my using a later version?