*   >> Lese Utdanning Artikler >> science >> programming

iPhone kjernedata Tutorial Part 2

#import "EditingViewController.h"

#import "PhotoViewController.h"

implementation RecipeDetailViewController

synthesize oppskrifter, photoButton;

- ( void) viewDidLoad {

[superviewDidLoad];

self.navigationItem.rightBarButtonItem = self.editButtonItem;

self.tableView.allowsSelectionDuringEditing = JA;

}

- (void) viewWillAppear: (BOOL) animert {

[superviewWillAppear: animerte];

self.title = recipes.recipeName;

[photoButtonsetImage: recipes.

recipeThumbnailImage forState: UIControlStateNormal];

[selfupdatePhotoButton];

[self.tableView reloadData];

}

- (void ) setEditing: (BOOL) redigering animerte: (BOOL) animert {

[supersetEditing: editinganimated: animerte];

[selfupdatePhotoButton];

}

- (void) didReceiveMemoryWarning {

[superdidReceiveMemoryWarning];

}

- (void) viewDidUnload {

}

# Pragma mark tabellvisning metoder

- (NSInteger) numberOfSectionsInTableView: (UITableView *) Tableview {

return1;

}

//Tilpass antall rader i tabellvisningen

- (NSInteger) Tableview: (UITableView *) Tableview numberOfRowsInSection:.

(NSInteger) section {

return2s;

}

//Tilpass utseendet på tabell vise celler

- (UITableViewCell *) Tableview:. (UITableView *) Tableview cellForRowAtIndexPath: (NSIndexPath *) indexPath {

staticNSString * CellIdentifier = @ "Cell ";

UITableViewCell * celle = [Tableview dequeueReusableCellWithIdentifier: CellIdentifier];

if (celle == null) {

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

cell.

editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;

}

//Sett opp celle ...

switch (indexPath.row ) {

case0:

cell.textLabel.text = @ "Name";

cell.detailTextLabel.text = recipes.recipeName;

pause ;

Tilfelle 1:

cell.textLabel.text = @ "Cooking Time";

cell.detailTextLabel.text = recipes.

cookingTime;

pause ;

standard:

break;

}

retur celle;

}

- (void) Tableview: (UITableView *) Tableview didSelectRowAtIndexPath: (NSIndexPath *) indexPath {

if (self.editing) {

EditingViewController * ed

Page   <<  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] >>
Copyright © 2008 - 2016 Lese Utdanning Artikler,https://utdanning.nmjjxx.com All rights reserved.