The problem is removing an item that´s been written using writeToFile:
method, I cannot seem to remove it. I tried NSFileManager but I guess these are two different
In this place
result = [fileManager removeItemAtURL:destinationURL error:&removeError];
NSLog(@"ERROR REMOVING OBJECT: %@",removeError);
you log and do not check the result value. Is it really NO
? You should check return value first, and then if it is NO
, check the removeError
.
And also I prefer to write
NSError * removeError = nil;
when declarate it. May be removeError
object contains some old information.