Skip to content

Instantly share code, notes, and snippets.

@qsun
Created October 10, 2012 10:24
Show Gist options
  • Save qsun/3864613 to your computer and use it in GitHub Desktop.
Save qsun/3864613 to your computer and use it in GitHub Desktop.
- (UITableViewCell *)tableView:(UITableViewController *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"table view");
static NSString * CellIdentifier = @"NewsCell";
UITableViewCell *cell;
cell = [dataController dequeueReusableCellWithIdentifier:CellIdentifier];
NSLog(@"Test");
/*
if (cell == NULL) {
cell = [[UITableViewCell alloc] init];
}
*/
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
News *news_at_index = [dataController objectInListAtIndex: indexPath.row];
NSLog(@"title is %@", news_at_index.title);
cell.textLabel.text = news_at_index.title;
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment