Skip to content

Instantly share code, notes, and snippets.

@jarinudom
Created March 27, 2009 03:02
Show Gist options
  • Save jarinudom/86508 to your computer and use it in GitHub Desktop.
Save jarinudom/86508 to your computer and use it in GitHub Desktop.
// In cellForRowAtIndexPath
static NSString *CellIdentifier = @"MyCustomCell";
MyCustomCell *cell = (MyCustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle]
loadNibNamed:@"MyCustomCell"
owner:nil options:nil];
for (id currentObject in topLevelObjects) {
if ([currentObject isKindOfClass:[UITableViewCell class]]) {
cell = (MyCustomCell *) currentObject;
break;
}
}
}
cell.myLabel.text = @"Blah blah";
return cell;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment