Im trying to create an folder in user library directory,but its not creating. Is there any mistake in the below code.
databaseName = @"KITSMAW0051_DB.sqlite";
// Get the path to the documents directory and append the databaseName
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
NSString *folder = @"Swasstik";
databasePath = [[documentsDir stringByAppendingPathComponent:folder ] stringByAppendingPathComponent:databaseName];
Ok first of all
databasePathdescribes a path to a file not a directory. But let’s say you actually want to create “Swasstik” folder inside user’s Library:Of course you can study and set the manager as you like and also implement some error handling. I hope that this makes sense…