2

Core Data can store binary data using External Storage if the file is large.

I'm using that External Storage to store images and show them in a UITableView. Before, I need to resize theses images to fit the size in the UI. So, I'm keeping in memory NSData properties from objects fetched and image resized.

Are there ways to handle this memory issue? or this approach is wrong?

Thanks.

1 Answer 1

3

You can use NSManagedObjectContext's: - refreshObject:mergeChanges: passing NO as the second parameter, this will turn the object back into a fault after you have used the data.

This way, you can get the image, resize it however you want, cache this image and then fault the ManagedObject to give up the data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.