1

NSFetchedResultsController喜欢我的UITableView. 它显示了一些来自我的数据库的带有谓词的实体。我试图找到一个优雅的解决方案来在我的数据行之间插入实用程序行。我不想在我的数据库中创建假实体,因为我不想混合视图和模型。但我需要有能力重新创建这个实用程序行(例如在其他应用程序启动时)。有什么建议么?

它应该看起来像这样:

在此处输入图像描述

4

1 回答 1

0

You're best bet, in my opinion, is to use a section header or footer for that "utility" row. In the case of Tweetbot, they're most likely caching results locally and then merge in data when the plus button is tapped. Your table will take multiple data sets as arrays (an array of arrays) and treat each separate array as a chunk and put it into its own section.

Any way you implement you'll want to wrap your results from the database with some sort of metadata. I think you're going to have to get away from a fetched results controller, unless you use a separate instance for each chunk, keeping track of the date range for each chunk.

于 2013-03-01T14:18:40.870 回答