Possible Duplicate:
adding images to UItableView
I want to add image in UITableView in the left hand side how could I add it?
In the cellForRowAtIndexPath
method add:
cell.imageView.image = [UIImage imageNamed:@"img.png"];
and thats it! really easy!
If you are using custom cells then you need to add an ImageView to your custom cell in IB. Then create, connect and synthesize an IBOutlet for it and add this code to the cellForRowAtIndexPath
method:
cell.yourImageOutlet.image = [UIImage imageNamed:@"img.png"];
Just add image in cellForRowAtIndexPath method
..
cell.imageView.image = yourImage;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With