NSFileManager URL vs Path

2019-06-25 14:18发布

问题:

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.