Sunday, February 3, 2013

ios - How to check if an item is already downloaded during search iPhone

I am developing an app that allows user to browse/search books and download them. There are 3 UITableView, download/search/browse

I want to show a 'download' button if not downloaded, otherwise, show 'open' button. It's straight forward in download tableview, I just query and show all books from core data.

The server is stateless and don't know if the user has downloaded the book or not.

I am saving the downloaded books in core data. When user search/browse by category start a new REST request and use the responded JSON to display the title and author name, etc.

What would be a good way to update determine if a book is downloaded in search view? query core data base each time in cellForRowAtIndexPath in main thread sounds expensive. I also want to update the UI status in real time when a background download finishes, so modify the JSON after download did not work either

Thanks

No comments:

Post a Comment

Search This Blog