开发者

How RSS reader knows which items I've already read, and which I have not?

开发者 https://www.devze.com 2023-01-06 00:08 出处:网络
I\'ve tried to find some info on the Internet, but couldn\'t. I\'m new to iphone development, but I have already learnt something. I\'ve created application which parses RSS feed and shows it, but I

I've tried to find some info on the Internet, but couldn't. I'm new to iphone development, but I have already learnt something. I've created application which parses RSS feed and shows it, but I haven't got a clue how to show user which items he has already read and which hasn't. I have some ideas but I don't know 开发者_运维知识库are they good or ridiculous. May be someone knows how it is usually done in many existing RSS readers.

Thank you a lot))


The easies way is to store all rss ids in NSUserDefault. Then when the application is loaded, they just load it to a NSSet, and check against the rss list

The other way is to have an attribute called isRead in the RSS news object (if you model your data in such a way), then serialize all the news using NSCoding with encodeWithCoder and initWithCoder to write and get back all objects and their attributes


The application will need to store information on which items have been read. Perhaps store the <guid> element of the item.

0

精彩评论

暂无评论...
验证码 换一张
取 消