I have a UITableView that uses the UITableViewCellStyleDefault style. I also have set the detail accessory:
cell.accessoryType= UITableViewCellAccessoryDetailDisclosureButton;
I want the code to be so that when the detail accessory is push, thus generating the delegate method accessoryButtonTappedForRowWithIndexPath: , the image of that particular cell is changed to another image.
How can I do that? Do I need to recreate the cell somehow?
Thank you!
no you have to just add the other image in the cell's imageview as
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.imageView.image = [UIImage imageNamed:@"IMAGENAME"];
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