Best way to copy or move files with Objective-C?

前端 未结 3 1841
有刺的猬
有刺的猬 2020-12-23 17:03

I was wondering, is there a best practice to write an OSX programm that copies or moves a file from one place to another?

  • is there some NSSomething method I c
3条回答
  •  情歌与酒
    2020-12-23 17:41

    [[NSFileManager defaultManager] copyItemAtPath:srcPath toPath:dstPath error:&error]

    Here's the link to the class reference:

    http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/copyItemAtPath:toPath:error:

提交回复
热议问题