Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.