views:

60

answers:

1

I am designing a web app that fetches data every time a user logs into his/her account. The data is an xml file containing image links and some text. I want this data (after image fetch/load from the actual link) to be stored locally so that every time an user opens the app it doesn't have to load everything from scratch. Locally stored contents should load first, then in the background some network processing shall be done so that the newer data is automatically updated. For storing the data I am planning to use SQLite but is there any other efficient way other than this to do the same ?

How does facebook app do this kind of stuff ? Thank you so much

A: 

The Facebook app is not really a web app but rather a native Cocoa Touch app.

If you are really creating a web app, your only option is to use localstorage and fetching new data asynchronously using XMLHTTPRequest.

If – on the other hand – your app is a native app, you’ll most likely want to use Core Data for storage and get incremental updates in a separate thread (or using libdispatch in case you’re only targetting post 4.0 devices) using a separate managed object context which you can then merge to the main thread using mergeChangesFromContextDidSaveNotification:.

Raphael Schweikert
@Raphael: Yeah mine is a native app. I though of using SQLite but there is no way to sync and refresh data as when it is loaded and everything has to be done manually. Is there any good Core data tutorial for iphone that I can refer to ?Thanks
I’ve found the Core Data tutorial by the author of “iPhone in Action” to be a valuable resource: http://iphoneinaction.manning.com/iphone_in_action/core-data/ (just read from the bottom up). There is no syntax highlighting on that blog, however, so it’s best to copy the code snippets into Xcode; otherwise they look quite frightening…
Raphael Schweikert
@samuel-joseph - See also the answers to this question: http://stackoverflow.com/questions/3164300/starting-point-in-learning-core-data-on-iphone
Brad Larson