I’m currently setting the UIImageView in my UITableViewCell like this:
// in cellForRowAtIndexPath method
[cell.imageView initWithImage:[UIImage imageNamed:@"myImage.png"]];
However the imageView property on UITableViewCell is readonly. The code above works but I don’t understand why. Any ideas?
Don’t ever call
-init...unless you’re creating an object yourself. The cell creates its own image view (that’s why it’s read-only); you can simply set the image withcell.imageView.image = [UIImage...];.