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

Chris McDaniel
Chris McDaniel
205 Points

self-destructing app sample: how to reload table on friends view controller?

I've got the self-destructing app sample working fine, except one small detail... how do I reload the tableview on the friends view controller after returning from edit friends view controller?

I can see the updates made on Parse when select/deselect a friend in the Edit Friends view controller, but I've confirmed via debug mode that my viewdidload function on the Friends view controller doesn't get invoked when I return back.

I'm using a push segue from the Friends view controller which invokes the Edit Friends view controller, and automatically places a back button in the navbar to get back to the Friends view controller. I'm just using this automatically generated back button to go back from the Edit Friends view controller to the Friends view controller.

Any ideas? What did I miss? I'm sure it's something quick/easy.

Thanks again for all your help. -chris

1 Answer

You'll want to create the - (void)viewWillAppear method in the FriendsViewController implementation file. You can either copy all of the code from the viewDidLoad method and paste it in the viewWillAppear method or copy the code from the viewDidLoad method, create an entirely new method and name it something like "findCurrentFriends" and paste the code there, and then finally call the "findCurrentFriends" method in both the viewDidLoad and viewWillAppear method.