I try to read all the files in the simulator in the Documents directory, but I get a Cocoa 260 error message. When I log into the [self applicationDocumentsDirectory] log, it says / var / root / Documents. Does anyone know why this will happen? This only happens when starting from the command line. When launched in the simulator itself, the code correctly displays the right document folder for the simulator.
UPDATE Now I see the file path: // localhost / Users / MyUserName / Documents. So strange...
- (NSString *)applicationDocumentsDirectory { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil; return basePath; }
source share