I have a bit of code that takes a thumbnail, applies a CoreImage filter to it, then sets it to a custom UITableViewCell's imageView property:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
CIImage *inputImage = [[CIImage imageWithCGImage:self.thumbnail.CGImage]retain];
CIFilter *filter = [[CIFilter filterWithName:@"CISepiaTone" keysAndValues:
kCIInputImageKey, inputImage,
@"inputIntensity", [NSNumber numberWithFloat:1.0],
nil] retain];
CIImage *outputImage = [[filter outputImage] retain];
CGImageRef cgimage = [self.context createCGImage:outputImage fromRect:[outputImage extent]];
filtersTableViewCellItem.thumbnail = [UIImage imageWithCGImage:cgimage];
[filter release];
[outputImage release];
[inputImage release];
CGImageRelease(cgimage);
dispatch_async(dispatch_get_main_queue(),
^{
UITableViewCell *tableViewCell = [[self cellForRowAtIndexPath:indexPath] retain];
if (tableViewCell)
{
[filtersTableViewCell.activityIndicatorView stopAnimating];
filtersTableViewCell.imageView.image = filtersTableViewCellItem.thumbnail;
}
[tableViewCell release];
});
});
The thumbnail is being produced properly, however it is not updating itself on the imageView. I've tried doing setNeedsDisplay to not avail. The funny thing is, when I've used similar code like this, but haven't used a custom UITableViewCell, it's worked perfectly fine. Anyone have any insight as to why this might not be working?