Hello, i have an UITableView in my app and i have to load some images that have a fixed width but different heights. I download the images async using an NSOperationQueue and for resizing and cropping i tried to use the solution provided by Jane Sales in this post link text.
i made a custom UITableViewCell class and in it i have a method that is called when the queued operation finishes to download the image. The method is called properly and the images are displayed. When i try to resize the images using the method proposed by Jane the problems appear. When it reaches [sourceImage drawInRect:thumbnailRect]; i receive an exec bad access error and i can't figure out why. I call the method like this:
- (void) setupImage:(UIImage *) anImage{
UIImage *resized = [anImage imageByScalingAndCroppingForSize:CGSizeMake(64, 59)];
if(resized == nil)
resized = [UIImage newImageFromResource:@"thumb2.png"];
[thumbnailView setImage:resized];
}
setupImage is the function called when the NSOperationQueue finishes the download action of anImage.
Could someone give me a clue why i receive the exec bad access error when i try to resize and crop the images? I tried using the same function outside the table view. 80% of the cases it works but there are cases when i receive the same exec bad access error.
Thank you in advance, Sorin