Hi - my first posting - been searching for help and trying not to post a dumb question, but can't find a solution...
I have the following code in my cellForRowAtIndexPath method:
Code:
NSMutableSet *rowSet = [oneObject mutableSetValueForKey: @"photos"];
// If the user has photos attached, sort them in the order they were added, and grab the first one...
if ([rowSet count] > 0) {
NSMutableArray *rowArray = [NSArray arrayByOrderingSet:rowSet byKey:@"uniqueID" ascending:YES];
// Get the first photo they added - use it as row image for table
NSManagedObject * relatedObject = [rowArray objectAtIndex:0];
// Assign the image to the cell
cell.imageView.image = (UIImage*) [relatedObject valueForKey:@"photoData"];
}
else
[[cell imageView] setImage:self.emptyImage];
When I grab a photo from CoreData and assign it to the cell's ImageView.Image, it shows up just fine. If there are only a dozen or so rows that I scroll through, no problem. As soon as I scroll through the whole list of 50 or so rows, I start to get "Received memory warning. Level=1" and a few rows later - crash.
None of this happens in the simulator, nor does Instruments find any leaks...
If I copy the image from the ManagedObject to the Cell, using an intermediary GraphicContext type of thing, it works, and the leaks go away but it is painfully slow - too slow for actual usage...
Help!!! Please.