开发者

How to use NSFetchedResultsController to support managing data on UITableView like iPhone Photo app

I am a beginner for iPhone development, I use core data as backed store and show multiple data entities on UITableView. Each data entity will be show as a preview thumbnail, one table view cell will hold 1 to 4 thumbnail. That's means 3 table cells may show at most 12 data entities, j开发者_StackOverflow中文版ust like iPhone Photo.

I also need operate to each of the preview thumbnail directly, never for the whole table view cell.

If show one data entity on one table cell, NSFetchedResultsController is perfect. But on my scenario, the NSFetchedResultsController's index path is not match with table view's index path. May I know what's the good practice to use NSFetchedResultsController on this case? should I use table view to support this implementation?


I don't know if it implements the exact class you want, but you may want to check out the three20 open source project. It contains most of the controls and such from the Facebook application. If it has the photo picker then you may be in luck.


I would create an entity that encapsulates 4 url strings. Then fetch that entity and feed those url strings to your class responsible for downloading the images.

If you don't want to do that, then you will have to fall back on the normal NSFetchRequest and parse the retuned data yourself. Just go through the returned array and pull of 4 urls at a time. Should be a trivial piece of code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜