cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
//Mettre en place la cellule ...
commutateur (indexPath.row ) {
case0:
cell.textLabel.text = @ "Nom";
cell.detailTextLabel.text = recipes.recipeName;
pause ;
affaire1:
cell.textLabel.text = @ "Temps de cuisson";
cell.detailTextLabel.text = recipes.
cookingTime;
pause ;
par défaut:
pause;
}
cellule de retour;
}
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
Si (self.editing) {
* editingview EditingViewController = [[EditingViewControlleralloc] initWithNibName: @ bundle "EditingViewController": [NSBundlemainBundle]];
editingview.recipes = recettes;
[self.
navigationControllerpushViewController: editingview animée: OUI];
[editingview presse];
}
else {
[tableView deselectRowAtIndexPath: indexPath animé: OUI];
}
}
- (UITableViewCellEditingStyle) tableView: (UITableView *) tableView editingStyleForRowAtIndexPath: (NSIndexPath *) indexPath {
returnUITableViewCellEditingStyleNone;
}
- (BOOL) tableView: (UITableView *) tableView shouldIndentWhileEditingRowAtIndexPath :( NSIndexPath *) indexPath {
returnNO;
}
#pragma mark -
#pragma Photo Mark
- (IBAction) photoButtonPressed {
Si (self.
editing) {
* UIImagePickerController imagePicker = [[UIImagePickerControlleralloc] init];
imagePicker.delegate = auto;
[selfpresentModalViewController: imagePicker animé: OUI];
[imagePicker presse];
}
else {
* PhotoViewController Photoview = [[PhotoViewControlleralloc] initialisation ];
photoView.recipes = recettes;
[self.
navigationControllerpushViewController: Photoview animé: OUI];
[libération Photoview];
}
}
- (void) imagePickerController: (UIImagePickerController *) Préparateur didFinishPickingImage: (UIImage *) SelectedImage editingInfo: (NSDictionary *) editingInfo {
* NSManagedObject oldImage = recettes. recipeImage;
Si (oldImage = néant!) {
[recipes.managedObjectContextdeleteObje