Pages

August 2, 2013

Create a folder in App Documents directory

A helpful method for creating a folder in the "Documents" directory of your iOS device (iPhone, iPad, iPod).
You need:
- http://objective-c-functions.blogspot.com/2013/07/get-documents-directory-of-your-app.html
- http://objective-c-functions.blogspot.com/2013/07/create-directory-in-ios-file-system.html


/** Creates a folder in the /Documents directory.

 @param folderNameOrPath String representing the folder name, optionally with its path (full or relative).
 @return Returns true if success, false otherwise.
 @see createFolderInTempDirectoryWithName:
 @see createFolderWithName:
 @see documentsDirectory

 */
+ (BOOL)createFolderInDocumentDirectoryWithName:(NSString *)folderNameOrPath {
    NSString *path = [[LMFunctions documentsDirectory] stringByAppendingPathComponent:folderNameOrPath];
    return [LMFunctions createFolderWithName:path];
}



Download the ready-for-use source file (.m) of Create a folder in App Documents directory

No comments:

Post a Comment