how to get URL Path for directory inside Document directory?

前端 未结 4 1105
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-19 10:53

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

like Document/Art/

My code

- (NSURL *)localRoot {
         


        
4条回答
  •  生来不讨喜
    2021-01-19 11:22

    Use this

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    
    NSString *documentsDirectory = [paths objectAtIndex:0];
    
    NSString *appFile_a = [documentsDirectory stringByAppendingPathComponent:@"/Art"];
    

提交回复
热议问题