Cocoa - NSFileManager removeItemAtPath Not Working

Posted by Kevin on Stack Overflow See other posts from Stack Overflow or by Kevin
Published on 2011-01-07T02:23:30Z Indexed on 2011/01/07 2:54 UTC
Read the original article Hit count: 270

Filed under:
|
|
|
|

Hey there everyone,

I am trying to delete a file, but somehow nsfilemanager will not allow me to do so. I do use the file in one line of code, but once that action has been ran, I want the file deleted. I have logged the error code and message and I get error code: 4 and the message:

"text.txt" could not be removed

Is there a way to fix this error "cleanly" (without any hacks) so that apple will accept this app onto their Mac App Store?

EDIT:

This is what I am using:

[[NSFileManager defaultManager] removeItemAtPath:filePath error:NULL];

Thanks,

kevin

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa