简体   繁体   中英

Save rss feed / swift2 / iOS

I'm writing an app for a blog. The posts will be parsed with XMLParser.

How can I store the posts on the iPhone so they don't need to be downloaded and parsed every time the app will be started AND more important so the app will not stay blank if there is no connection to the internet.

I know core data is what I have to use. But how? Thank you for your help.

To resolve your storage issue and offline availability of service you can use
1. Core Data
2. SQLite database.

  • So after parsing feeds, you should insert them into database. And when will appear fetch records from database and reload in tableview.
  • On other hand when internet connection is available then make a network call to fetch new records from server and insert/save them to database and reload table again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM