Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. // Important for being sure all view controllers are allocated and initialized
  2. for(UIViewController * viewController in [self viewControllers]) {
  3. [viewController view];
  4. }
  5.  
  6. - (DataTableViewContentCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  7. {
  8. static NSString *contentCell = @"ContentCell";
  9. DataTableViewContentCell *cell = [tableView dequeueReusableCellWithIdentifier:contentCell];
  10.  
  11. if (!cell)
  12. {
  13. cell = [[DataTableViewContentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:contentCell];
  14. }
  15.  
  16. NSDictionary *dictionary = data[[indexPath section]];
  17. NSArray *array = dictionary[@"contents"];
  18. NSString *contentName = array[[indexPath row]];
  19.  
  20. [[cell contentNameLabel] setText:contentName];
  21.  
  22. return cell;
  23. }
  24.  
  25. # pragma mark - UI update
  26.  
  27. - (void)updateEntryCountWithIndexPathSection:(NSInteger)indexSection
  28. Row:(NSInteger)indexRow
  29. EntryCount:(NSInteger)entryCount
  30. {
  31. NSIndexPath *indexPath = [NSIndexPath indexPathForRow:indexRow inSection:indexSection];
  32. DataTableViewContentCell* cell = (DataTableViewContentCell*) [[self dataTableView] cellForRowAtIndexPath:indexPath];
  33. [[cell entryNumberLabel] setText:[NSString stringWithFormat:@"%d", entryCount]];
  34. NSLog(@"%@",[[cell contentNameLabel] text]); // Initially visible cells return correct name, the others return null
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement