Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1.  
  2. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  3. return 3;
  4. }
  5.  
  6. - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
  7. NSString *header = nil;
  8. switch (section) {
  9. case 1:
  10. header = @"Fuck that noise";
  11. break;
  12. case 2:
  13. header = @"People doing it";
  14. break;
  15. }
  16. return header;
  17. }
  18.  
  19. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  20. if (section == 1) {
  21. return 2;
  22. }
  23. return 1;
  24. }
  25.  
  26. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  27. NSString *text;
  28. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"campaignDetailCell" forIndexPath:indexPath];
  29. if (indexPath.section == 0) {
  30. if (indexPath.row == 0) {
  31. text = self.campaign.callToAction;
  32. }
  33. }
  34. else if (indexPath.section == 1) {
  35. text = @"Allo, mate";
  36. if (indexPath.row == 0) {
  37. text = self.campaign.factSolution;
  38. }
  39. }
  40. else if (indexPath.section == 2) {
  41. text = @"Reportback pic";
  42. }
  43. cell.textLabel.text = text;
  44. return cell;
  45. }
  46.  
  47.  
  48. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement