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 Build a Self-Destructing Message iPhone App Relating Users in Parse.com Removing Friends by Tapping on a Table View Cell

Ryan Stevenson
Ryan Stevenson
1,799 Points

Friend Removal - TableView not refreshing

When you remove a friend from the "Edit Friend" Table View Controller, the array, back end and tick all get removed. However when you go back to the friends tab, the list has not updated.

How would I call an update from the list to get it to update?

Thanks, Ryann

2 Answers

Ryan,

You can call reload data on the table view, e.g. [myTableView reloadData], to reload all data in the table. Since you are dealing with Parse you will need to execute the query to get the most current list of friends for the table first. I am pretty sure that they covered this at some point in the video as it is mentioned in the Teachers notes. I believe they implemented the code in the viewWillAppear method. viewWillAppear gets called everytime a view is about to be displayed, while viewDidLoad only gets called once when the view is first created.

Ryan Stevenson
Ryan Stevenson
1,799 Points

Hi Dennis,

Thanks for your response. I posted this before I had finished the section. In future I will wait until I have finish the current stage before asking the question.

Cheers for your fast response though.

Thanks, Ryann