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.