*   >> Lecture Éducation Articles >> science >> la programmation

iPhone de base de données Tutorial Part 2

ellule = [[[UITableViewCellalloc] initWithStyle: UITableViewCellStyleValue2reuseIdentifier: CellIdentifier] autorelease];

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

Page   <<  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] >>
Copyright © 2008 - 2016 Lecture Éducation Articles,https://lecture.nmjjxx.com All rights reserved.