Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Update labels with a change of a table view row?

I have a tableView subview with labels below that I want to update each time a row is deleted or inserted.
Here's an example: https://www.dropbox.com/s/mp5r9eiv8tg3fmj/Screenshot%202015-02-03%2018.58.24.png?dl=0 The "remaining" labels are what I want to update however if I call my "setLabels" method in "viewWillAppear" only inserting rows will update the labels. If I put my setLabels method in

"controllerDidChangeObject : deleteRowsAtIndexPath and :insertRowsAtIndexPath"

only the deletion of a row will update the labels.

Is there a way to update these labels when adding AND removing a row?

Thanks for any help!

right needed [self performSelector:@selector(setLabels) withObject:nil afterDelay:0.1]; after endUpdates.