Skip to content

Instantly share code, notes, and snippets.

@pierrevalade
Created May 25, 2011 10:07
Show Gist options
  • Save pierrevalade/990710 to your computer and use it in GitHub Desktop.
Save pierrevalade/990710 to your computer and use it in GitHub Desktop.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *IngredientsCellIdentifier = @"IngredientsCell";
EditingTableViewCell *cell = (EditingTableViewCell *)[tableView dequeueReusableCellWithIdentifier:IngredientsCellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"EditingTableViewCell" owner:self options:nil];
cell = editingTableViewCell;
self.editingTableViewCell = nil;
}
if (indexPath.row == 0) {
cell.label.text = @"Ingredient";
cell.textField.text = ingredient.name;
cell.textField.placeholder = @"Name";
}
else if (indexPath.row == 1) {
cell.label.text = @"Amount";
cell.textField.text = ingredient.amount;
cell.textField.placeholder = @"Amount";
}
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment