I am developing an application in cocoa which needs to copy a folder added to resource to other location in System/library .How can i specify the source and destination path.Looking for a solutio开发者_JAVA百科n
Thanks in advance
I am developing an application in cocoa which needs to copy a folder added to resource to other location in System/library .
- It sounds like you're writing an installer. Use PackageMaker; don't write your own custom installer. There are a thousand edge cases that Installer already handles and your custom installer will not.
- Do you really need to install this file in /System? The only kind of thing that absolutely needs to be there is a driver. If what you're installing is anything else, the answer is no, and you should not install it to /System.
You'd use NSFileManager
which has really nice convenient methods. There is method like
- (BOOL)copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error
And here's the description of it from apple docs:
Copies the directory or file specified in a given path to a different location in the file system identified by another path.
精彩评论