*   >> Lectura Educación Artículos >> science >> programación

iPhone Core Data Tutorial Parte 2

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"];

Page   <<  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] >>
Copyright © 2008 - 2016 Lectura Educación Artículos,https://lectura.nmjjxx.com All rights reserved.