case0:
cell.textLabel.text = @ "Nombre";
cell.detailTextLabel.text = recipes.recipeName;
ruptura ;
case1:
cell.textLabel.text = @ "Tiempo de cocción";
cell.detailTextLabel.text = recipes.cookingTime;
ruptura ;
De forma predeterminada:
break;
}
celular retorno;
}
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
si (self.
editing) {
EditingViewController * editingview = [[EditingViewControlleralloc] initWithNibName: @ paquete "EditingViewController": [NSBundlemainBundle]];
editingview.recipes = recetas;
[self.navigationControllerpushViewController: editingview animado: YES];
[liberación editingview];
}
else {
[tableView deselectRowAtIndexPath: indexPath animada: YES];
}
}
- (UITableViewCellEditingStyle) tableView: (UITableView *) tableView editingStyleForRowAtIndexPath: (NSIndexPath *) indexPath {
returnUITableViewCellEditingStyleNone;
}
- (BOOL) tableView: (UITableView *) tableView shouldIndentWhileEditingRowAtIndexPath :( NSIndexPath *) indexPath {
returnNO;
}
marca pragma -
#pragma mark Foto
- (IBAction) photoButtonPressed {
si (self.
editing) {
UIImagePickerController * imagePicker = [[UIImagePickerControlleralloc] init];
imagePicker.delegate = auto;
[selfpresentModalViewController: imagePicker animada: YES];
[liberación imagePicker];
}
else {
PhotoViewController * Photoview = [[PhotoViewControlleralloc] init ];
photoView.recipes = recetas;
[self.
navigationControllerpushViewController: Photoview animado: YES];
[liberación Photoview];
}
}
- (void) imagePickerController: (UIImagePickerController *) selector didFinishPickingImage: (UIImage *) SelectedImage editingInfo: (NSDictionary *) editingInfo {
NSManagedObject * oldImage = recetas. recipeImage;
si (oldImage = nil!) {
[recipes.managedObjectContextdeleteObject: oldImage];
}
RecipeImage * image = [NSEntityDescriptioninsertNewObjectForEntityForName:@"RecipeImage"inManagedObjectContext:recipes.
managedObjectContext];
recipes.recipeImage = Imagen;
[imagen setValue: SelectedImage forKey: @ "recipeImage"];
6