0

Hi every one I have built a poem application for iphone.

Now I want to create a bookmark page for my poems. I import cells list with MyCell.Plist and my poems are HTML files. Now I want to create a bookmark page for favourite poems.
How can I do that?

Nifle
  • 11,745
  • 10
  • 75
  • 100
Mc.Lover
  • 4,813
  • 9
  • 46
  • 80

1 Answers1

2

How are your poems being displayed? In a UITableView? Where are the poems being persisted?

If your poems existed in a CoreData store you could add an extra property "isFavorite" and set it from your UI, you could then sort based on that flag.

jessecurry
  • 22,068
  • 8
  • 52
  • 44
  • yes with a UITableViw ... the poems shows on the anotherview and loaded as HTML. i don't use CoreData – Mc.Lover Jan 27 '10 at 10:14
  • where are you pulling the poems from? Are they in a file? Loaded over the network? On a site? – jessecurry Jan 27 '10 at 19:05
  • aha .... my poems files are HTML and they imported to the project . and my UIWebview load poems directly files had imported . – Mc.Lover Jan 27 '10 at 19:15
  • in that case I'd probably use either core data, sqlite, or just NSArchiver to store an index of the files and a flag listing if the file if favorite... Maybe you could have an Array of Dictionaries, each dictionary could have the file path, a favorite flag, and an order so they could rearrange them in the list view. – jessecurry Jan 27 '10 at 20:11
  • is there any tutorial or sample code? sorry iam new to iphone sdk – Mc.Lover Jan 27 '10 at 20:28
  • http://stackoverflow.com/questions/1148853/loading-a-singletons-state-from-nskeyedarchiver may help out a little if you choose to use an NSKeyedArchiver (also see the Apple docs).... I would really recommend storing your data in a database though, HTML strings can be pushed into SQLite and used easily. – jessecurry Jan 27 '10 at 21:39