Guest User

Untitled

a guest
Nov 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. - (id)tableView:(UITableView*)tableView objectAtIndexPath:(NSIndexPath*)indexPath
  2. {
  3. if (indexPath.section == TAPSearchDataSourceSectionTopTalkers) {
  4. if ((indexPath.row == [tableView numberOfRowsInSection:0] - 1) && self.shouldShowAutocompleteTalker && [self autocompletedTalker]) {
  5. return self.autocompletedTalker;
  6. } else if (!self.topTalkers.count || indexPath.row > self.topTalkers.count - 1) {
  7. return self.searchService.serverSearchResultsForTalkers[indexPath.row - self.topTalkers.count];
  8. }
  9. return self.topTalkers[indexPath.row];
  10. } else if (indexPath.section == TAPSearchDataSourceSectionTopConversations) {
  11. if (!self.topConversations.count || indexPath.row > self.topConversations.count - 1) {
  12. return self.searchService.serverSearchResultsForConversations[indexPath.row - self.topConversations.count]; <- crash here
  13. }
  14.  
  15. return self.topConversations[indexPath.row];
  16. } else if (indexPath.section == TAPSearchDataSourceSectionMoreTalkers) {
  17. return self.moreTalkers[indexPath.row];
  18. } else if (indexPath.section == TAPSearchDataSourceSectionMoreConversations) {
  19. return self.moreConversations[indexPath.row];
  20. } else if (indexPath.section == TAPSearchDataSourceSectionServerResult) {
  21. if (self.searchService.serverSearchResultsForTalkers.count > 0) {
  22. return self.searchService.serverSearchResultsForTalkers[indexPath.row + self.numberOfServerTalkerToCompleteLocalTalkers];
  23. }
  24.  
  25. return self.searchService.serverSearchResultsForConversations[indexPath.row + self.numberOfServerConversationToCompleteLocalConversations];
  26. }
  27.  
  28. return nil;
  29. }
Add Comment
Please, Sign In to add comment