Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get URL Path for directory inside Document directory?

How can I get url path for a particular directory inside Document Directory.

like Document/Art/

My code

- (NSURL *)localRoot {
if (_localRoot != nil) {
    return _localRoot;
}

NSArray * paths = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];

_localRoot = [paths objectAtIndex:0];
return _localRoot;
}

The above code is url path for Documents directory but I need Art document directory path.

like image 656
Vijay Avatar asked Dec 16 '22 14:12

Vijay


1 Answers

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

NSString *documentsDirectory = [paths objectAtIndex:0];

NSString *yourArtPath = [documentsDirectory stringByAppendingPathComponent:@"/Art"];
like image 75
Rajneesh071 Avatar answered Feb 24 '23 08:02

Rajneesh071