Skip to content

Instantly share code, notes, and snippets.

@ninthspace
Created May 19, 2012 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninthspace/2731312 to your computer and use it in GitHub Desktop.
Save ninthspace/2731312 to your computer and use it in GitHub Desktop.
Choosing between XIBs
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
TaskItem *task = [fetchedResultsController objectAtIndexPath:indexPath];
TaskItemCell *cell;
// check display settings
if ([[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"%d", AlistoPrefKeyTypeShowTaskNumbers]]) {
cell = [tableView dequeueReusableCellWithIdentifier:@"TaskItemCellWithID"];
} else {
cell = [tableView dequeueReusableCellWithIdentifier:@"TaskItemCell"];
}
[cell setController:self];
[cell setTableView:tableView];
[cell setWithTaskItem:task];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment