hbf369

在Info.plist里添加一行配置信息即可

设置Application supports iTunes file sharing为YES.

以下是返回该目录下文件路径的代码:

 

-(NSString*)shareFilePath:(NSString*)filePath {

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

    NSString *documentsDirectory = [paths objectAtIndex:0];

    return [documentsDirectory stringByAppendingPathComponent: filePath];

}

执行方法[xxx shareFilePath:@"Data.Index"]即可返回该目录下Data.Index的绝对路径。

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2021-11-20
  • 2021-05-12
  • 2021-07-13
  • 2021-11-30
  • 2021-06-07
猜你喜欢
  • 2021-11-11
  • 2021-12-28
  • 2021-12-14
  • 2021-10-10
  • 2021-10-31
  • 2022-12-23
  • 2021-07-03
相关资源
相似解决方案