有没有区别
NSURL *referenceURL, *destinationURL ;
[[[NSFileManager alloc] init] copyItemAtURL:referenceURL
toURL:destinationURL
error:NULL] ;
和
NSURL *referenceURL, *destinationURL ;
NSFileWrapperWritingOptions options ;
NSFileWrapper * fileWrapper = [[NSFileWrapper alloc] initWithURL:referenceURL
options:0
error:NULL] ;
[fileWrapper writeToURL:destinationURL
options:options
originalContentsURL:nil
error:NULL] ;
(特别是,取决于选项的值;这里的选项的最佳选择是什么?)?
我问这个问题是为了更好地理解 NSFileWrapper。我看到我可以在我的代码中选择使用其中一个。我想答案可能涉及对“硬链接”的考虑。
PS:我想在后台使用这些方法中的任何一种。