Search code examples
iphonedirectorynsfilemanager

createDirectoryAtPath:attributes: alternative


[NSFileManager createDirectoryAtPath:attributes:] gives me a warning that it is depreciated.

What is the alternative? Or is there a better way of doing this?

Thanks

Tom


Solution

  • Use createDirectoryAtPath:withIntermediateDirectories:attributes:error:

    P.S.

    createIntermediates If YES, then the method will also create any necessary intermediate directories; if NO, then the method fails if any parent of the directory to be created does not exist. In addition, if you pass NO for this parameter, the directory must not exist at the time this call is made.