I use CoreData to store image data that user took from iPhone's Camera. Over time, the memory consumed by these objects keep increasing, but I don't know how to clear those objects from the memory.
How should this be done?
You can tell the managedObjectContext to retain or not retain objects (in addition to the ones you retain) with:
[managedObjectContext setRetainsRegisteredObjects:YES];
See http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/index.html?http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html for a discussion of what this does.
Note that you also have to be careful not to retain and leak the objects yourself, or this will have no effect.
-Wil
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With