PhotoWheel
PhotoWheel copied to clipboard
Stored images in document store are not included in delete methods
I am currently looking into ways to remedy this.
Here's what you would need to do to delete external image files, which were added in chapter 23:
- Add a
prepareForDeletion
method inPhoto.m
. This gets called automatically any time a managed object is going to be deleted. - In this method, look up the file URL for each of the image files
- Use
NSFileManager
to delete the image files.
Thanks Tom! I'll try that out and let you know the results. ~ Adam
Tom, this is confirmed to work like a charm! - (void)prepareForDeletion in Photo.m. My code is rather crude and in a unit test form, but if anyone is interested in getting it, let me know, and perhaps by that time it'll be more efficient. Cheers, and Happy Holidays!