3232#import " TweetSearchCell.h"
3333#import " UserSearchCell.h"
3434#import " TaskSearchCell.h"
35-
35+ # import " ProjectTopicCell.h "
3636
3737// nav--------
3838#import " TweetDetailViewController.h"
@@ -157,6 +157,8 @@ - (void)initSearchResultsTableView {
157157 [tableView registerClass: [FileSearchCell class ] forCellReuseIdentifier: @" FileSearchCell" ];
158158 [tableView registerClass: [UserSearchCell class ] forCellReuseIdentifier: @" UserSearchCell" ];
159159 [tableView registerClass: [TaskSearchCell class ] forCellReuseIdentifier: @" TaskSearchCell" ];
160+ [tableView registerClass: [ProjectTopicCell class ] forCellReuseIdentifier: @" ProjectTopicCell" ];
161+
160162
161163 tableView.dataSource = self;
162164 tableView.delegate = self;
@@ -377,6 +379,9 @@ -(void)reloadDisplayData{
377379 case eSearchType_Task:
378380 [self .dateSource addObjectsFromArray: _searchPros.tasks.list];
379381 break ;
382+ case eSearchType_Topic:
383+ [self .dateSource addObjectsFromArray: _searchPros.project_topics.list];
384+ break ;
380385 default :
381386 break ;
382387 }
@@ -404,6 +409,9 @@ - (void)refreshHeaderTitle{
404409 case eSearchType_Task:
405410 titleStr=[NSString stringWithFormat: @" 共搜索到 %ld 个与\" %@ \" 相关的任务" , [_searchPros.tasks.totalRow longValue ],self .searchBar.text];
406411 break ;
412+ case eSearchType_Topic:
413+ titleStr=[NSString stringWithFormat: @" 共搜索到 %ld 个与\" %@ \" 相关的讨论" , [_searchPros.project_topics.totalRow longValue ],self .searchBar.text];
414+ break ;
407415 default :
408416 break ;
409417 }
@@ -471,6 +479,9 @@ - (void)requestDataWithPage:(NSInteger)page {
471479 case eSearchType_Task:
472480 [weakSelf.dateSource addObjectsFromArray: _searchPros.tasks.list];
473481 break ;
482+ case eSearchType_Topic:
483+ [weakSelf.dateSource addObjectsFromArray: _searchPros.project_topics.list];
484+ break ;
474485 default :
475486 break ;
476487 }
@@ -558,6 +569,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
558569 cell.task =task;
559570 [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
560571 return cell;
572+ }else if (_curSearchType==eSearchType_Topic){
573+ ProjectTopicCell *cell = [tableView dequeueReusableCellWithIdentifier: @" ProjectTopicCell" forIndexPath: indexPath];
574+ ProjectTopic *topic =_dateSource[indexPath.row];
575+ cell.curTopic = topic;
576+ [tableView addLineforPlainCell: cell forRowAtIndexPath: indexPath withLeftSpace: kPaddingLeftWidth ];
577+ return cell;
561578 }else {
562579 return nil ;
563580 }
@@ -575,6 +592,8 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
575592 return kUserSearchCellHeight ;
576593 }else if (_curSearchType==eSearchType_Task){
577594 return kTaskSearchCellHeight ;
595+ }else if (_curSearchType==eSearchType_Topic){
596+ return [ProjectTopicCell cellHeightWithObj: _dateSource[indexPath.row]];
578597 }else {
579598 return 100 ;
580599 }
0 commit comments