createDirectoryAtPath: is depreceated

Discussion in 'Mac Programming' started by Blakeasd, Feb 8, 2011.

  1. Blakeasd macrumors 6502a

    Dec 29, 2009
    I recently upgraded to a newer version of Xcode (Under NDA).
    It works fine in my older Xcode version ,but no I get depreciation errors, so I have to replace it with something. (Xcode 3.2 only warned me). Does anyone know an equivalent to createDirectoryAtPath: that has not been deprecated.
  2. ccamelot macrumors member


    Feb 21, 2010
    Here you go

    From NSFileManager.h:

    /* createDirectoryAtPath:withIntermediateDirectories:attributes:error: creates a directory at the specified path. If you pass 'NO' for createIntermediates, the directory must not exist at the time this call is made. Passing 'YES' for 'createIntermediates' will create any necessary intermediate directories. This method returns YES if all directories specified in 'path' were created and attributes were set. Directories are created with attributes specified by the dictionary passed to 'attributes'. If no dictionary is supplied, directories are created according to the umask of the process. This method returns NO if a failure occurs at any stage of the operation. If an error parameter was provided, a presentable NSError will be returned by reference.

    This method replaces createDirectoryAtPath:attributes:
    - (BOOL)createDirectoryAtPath:(NSString *)path withIntermediateDirectories:(BOOL)createIntermediates attributes:(NSDictionary *)attributes error:(NSError **)error;
    all best
  3. Blakeasd thread starter macrumors 6502a

    Dec 29, 2009
    Works Now

    Thanks it works now. Where can I find the replacements for depreciated methods as I still have one more that is depreciated.
  4. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX

    That's a link to a deprecated method in the docs. It's unlikely that a method will be removed without a replacement, though it's possible. In this case, though, there is details about the replacement you should use. I'd say look at the docs when you run into a deprecated method. In your case:

    The method mentioned above is right there.

    Also, don't break NDAs. You didn't have to say anything about it here, that method was deprecated in 10.5.

  5. foidulus macrumors 6502a

    Jan 15, 2007
    What Lee said, I would also add that changes in deprecation/removal of methods(which is quite rare, however Apple has removed entire libraries before) only happen when new versions of the operating system are released, XCode has no effect on them. XCode is an IDE, the actual libraries and whatnot are all provided by the OS.

Share This Page