views:

143

answers:

1

I have a table view, which populates data from the web. To add information to this list I have a configuration screen presented modally. When data is added successfully the configuration screen is dismissed, I would like the data in the table view to automatically reload from the web to reflect the newly added data.

What is the best way to go about reloading this remote data after the configuration view is dismissed. I have tried a number of approaches including using a delegate to send information back and loading the data only on view will appear but would like to know the safest and most efficient way of doing this.

Thanks in advance!

A: 

You want to load it on view loading, it greatly simplifies things—Plus, it only loads data when your user wants it, thus saving him or her potentially some data on their conceivably limited data plan if on 3g.

While the data is loading, if the view has appeared, then you can display a "loading" view on top of your view, disable user interaction until it's done loading, then remove it from its superview and enable user interaction again, while presenting the data to your table view. This is generally how I've done it in the past, and how I'd look at doing it in the future.

jer
Do you mean viewDidLoad in the parent view? Because I have a function that initially gathers data when it appears. But viewDidLoad doesn't get called again when the views child is dismissed.
Convolution
yeah it won't be called again when it's dismissed. I mean you reload the data when the view is presented again in the child view.
jer