简体   繁体   中英

iOS NSFileManager Store file in Document directory using URLs not Paths?

Apple says it's better to use URLs to access files stored in the phone. But I can't find a method to create a new file at URLs. Are there Any? Or we must create file using a path and retrieve them using an URL ?

Thanks!

要将文件路径转换为URL,请使用fileURLWithPath类方法,如下所示:

NSURL *filePathURL = [NSURL fileURLWithPath:filePath];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM