1

I'm trying to create/write a pList file out side of the documents directory but I'm getting this error:

error writing to file: Error Domain=NSCocoaErrorDomain Code=4 "The folder “spanishPlayground-toys.plist” doesn’t exist." UserInfo=0x618000278200 {NSFilePath=/Users/myUser/Volumes/Depot/proyects/myApp/Assets/config.plist, NSUserStringVariant=Folder, NSUnderlyingError=0x618000247140 "The operation couldn’t be completed. No such file or directory"}

This is my code:

NSString *filePath = [NSHomeDirectory() stringByAppendingPathComponent:@"/Volumes/Depot/proyects/myApp/Assets/config.plist"];

BOOL writeStatus = [plistData writeToFile: filePath
                                  options: NSDataWritingAtomic
                                    error: &error]; if (!writeStatus) {
    NSLog (@"error writing to file: %@", error);
    return; }

Any of you has any idea of how can I write the file outside of the documents directory?

I'll really appreciate you help.

user2924482
  • 8,380
  • 23
  • 89
  • 173

0 Answers0