开发者

Tableview section By Date

How to group da开发者_JAVA百科ta in the tableview by date in Xcode?


Have a look at the DateSectionTitles sample app. It demonstrates a tableview with date cells grouped by the month. It is based on CoreData.

Tableview section By Date


First of all you need to find reasonable date groups: month, week, year-month combination etc. After that you'll have to find a method which can determine which of your cell has to go to which group/section, described as an NSIndexPath. numberOfSections as well as numberOfRowsInSection has to reflect your grouping idea. With the UITableViewDataSource protocol you can provide the names for your sections with titleForHeaderInSection:.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜