NSFileManager URL vs Path

牧云@^-^@ 提交于 2019-12-23 13:01:58

问题


Why is that URL methods like moveItemAtURL:toURL:error: of NSFileManager class are recommended over Path methods like moveItemAtPath:toPath:error: ?


回答1:


When NSURL objects are created it's also checked that the path is valid, otherwise the object is not created.

The path ones are created even if it's an invalid path. There are no checks made at all.



来源:https://stackoverflow.com/questions/30023679/nsfilemanager-url-vs-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!