Welcome, Guest
Username Password: Remember me

Reload TableView Cell after accessoryView has been tapped
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Reload TableView Cell after accessoryView has been tapped

Reload TableView Cell after accessoryView has been tapped 1 year, 7 months ago #1

Hi all,

I'm setting up the accessoryView of some SCTableViewCells in
- (void)tableViewModel:(SCTableViewModel *) tableViewModel willDisplayCell:(SCTableViewCell *) cell forRowAtIndexPath:(NSIndexPath *) indexPath


My accessoryView is a UIButton (with an image) which I add a target to:
[watchListButton addTarget:self action:@selector(toggleWatchListStatus) forControlEvents:UIControlEventTouchUpInside];


In toggleWatchListStatus I'm switching the UIButton's image.

Unfortunately the updated image doesn't show up. I need to scroll the according cell off the screen (so that it's not visible) and scroll back to make the button with the new image visible.

How do I update the affected SCTableViewCell so reflects the changes on UIButton accessoryView?

Thanks,
Patrick
  • Patrick
  • OFFLINE
  • Senior Boarder
  • Posts: 49
  • Karma: 3

Re: Reload TableView Cell after accessoryView has been tapped 1 year, 7 months ago #2

Hi Patrick,

Are you calling UIButton's "setNeedsDisplay" method after you change the image?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Reload TableView Cell after accessoryView has been tapped 1 year, 7 months ago #3

That's it. Thanks, Tarek!
  • Patrick
  • OFFLINE
  • Senior Boarder
  • Posts: 49
  • Karma: 3
  • Page:
  • 1
Time to create page: 0.79 seconds