6 Answers
6

I don't know a lot about iPhone programming or objective C, but out of curiosity, what is error in that case if the copy operation actually succeeded? Could it be the log lines that are crashing if there was no error?

[edit] Also, are you allowed to copy the entire contents of a subdirectory like that? (Again, I'm unfamiliar with the iOS API, just identifying possible sources of error based on what I know of other languages/APIs)

This is wrong. Apple's APIs do not promise to leave error parameters untouched in the case there is no error - it could be junk. As other posters have mentioned, the correct way is to disregard the error parameter if success is returned.
–
Mark AufflickJan 4 '12 at 5:00

Kenny, if an error happens the error will point to newly allocated error object. This is an output parameter. The address (!) to the pointer is given to the method. The error should not be initialized. See error handling in Apple's documentation.
–
MacMarkMay 9 '13 at 14:48

For some reason localizedDescription was not informative to let me know the file already exist (and I don't see how it's localized, it's giving me English). I had to use [error description] (still English).
–
huggieJan 9 '13 at 11:48