早教吧 育儿知识 作业答案 考试题库 百科 知识分享

Three20里面TTTalbeiewController如何实现section?平时一个继承了UIViewController的话,我想显示section,重写这个地方。-(NSString*)tableView:(UITableView*)tableViewtitleForHeaderInSection:(NSInteger)section{但是如果

题目详情
Three20 里面TTTalbeiewController如何实现section?平时一个继承了UIViewController的话,我想显示section,重写这个地方。- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {但是如果继承了TTTableViewController的话。貌似它里面并没有这个方法让我重载啊。如何实现section呢。
▼优质解答
答案和解析
看看Three20里自带的例子 TTCatalog 的源码吧。简单来说,你需要建一个 TTSectionedDataSource 对象,然后赋值给 TTTableViewController 的 dataSource 变量,不用重写 UITableView 的 delegate。