Вопрос

I am trying to move a file from a path to a directory at another path. I have the code in hand. But, its not working properly. I don't know what is wrong with that code.

if ([[NSFileManager defaultManager] moveItemAtPath:"path to be moved" toPath:"destination path" error:&error]) {
    NSLog(@"Moved");
} else {
    NSLog(@"Not moved:%@", [error localizedDescription]);
}  

Actually, if the moving process is successful, "Moved" will be printed. But the result prints the error message "The operation couldn’t be completed. (Cocoa error 512.)". Please help me to come out of this problem. Thanks in advance.

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top