Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Important for being sure all view controllers are allocated and initialized
- for(UIViewController * viewController in [self viewControllers]) {
- [viewController view];
- }
- - (DataTableViewContentCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *contentCell = @"ContentCell";
- DataTableViewContentCell *cell = [tableView dequeueReusableCellWithIdentifier:contentCell];
- if (!cell)
- {
- cell = [[DataTableViewContentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:contentCell];
- }
- NSDictionary *dictionary = data[[indexPath section]];
- NSArray *array = dictionary[@"contents"];
- NSString *contentName = array[[indexPath row]];
- [[cell contentNameLabel] setText:contentName];
- return cell;
- }
- # pragma mark - UI update
- - (void)updateEntryCountWithIndexPathSection:(NSInteger)indexSection
- Row:(NSInteger)indexRow
- EntryCount:(NSInteger)entryCount
- {
- NSIndexPath *indexPath = [NSIndexPath indexPathForRow:indexRow inSection:indexSection];
- DataTableViewContentCell* cell = (DataTableViewContentCell*) [[self dataTableView] cellForRowAtIndexPath:indexPath];
- [[cell entryNumberLabel] setText:[NSString stringWithFormat:@"%d", entryCount]];
- NSLog(@"%@",[[cell contentNameLabel] text]); // Initially visible cells return correct name, the others return null
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement