jordangrogan
jordangrogan

Reputation: 251

App update data from web periodically

I'm building an iPhone app where most of the content is dynamically loaded from my web server. The content is updated once per day. Here's the issue I ran into when testing my app on my device. I noticed that I would just close the app, and the next day I didn't see the new content. I had to go close the app fully (via multitasking) and then go back into it to update the content.

I could use this in the app delegate: - (void)applicationWillEnterForeground:(UIApplication *)application

but, I load all the content in each View Controller... how should I go about re-loading my data?

Also... If I update the array of objects that the data is pulled from in the UITableView, will the UITableView update automatically?

Thanks for any help!!

Upvotes: 0

Views: 191

Answers (1)

Phillip Mills
Phillip Mills

Reputation: 31026

Note the documentation for that method also says, "The application also posts a UIApplicationWillEnterForegroundNotification notification shortly before calling this method to give interested objects a chance to respond to the transition."

Your view controller could be considered an interested object.

Table views can be told to reloadData.

Upvotes: 1

Related Questions