*   >> Leitura Educação Artigos >> science >> programação

iPhone Core Data Tutorial Parte 2

property (nonatomic, reter) IBOutletUIButton * photoButton;

- (IBAction) photoButtonPressed;

- (void) updatePhotoButton;

< p>end

Open RecipeDetailViewController.m e digite o seguinte em:

#import "RecipeDetailViewController.h"

#import "Recipes.h"

#import "EditingViewController.h"

#import "PhotoViewController.h"

implementation RecipeDetailViewController

synthesize receitas, photoButton;

- ( void) viewDidLoad {

[superviewDidLoad];

self.navigationItem.rightBarButtonItem = self.

editButtonItem;

self.tableView.allowsSelectionDuringEditing = YES;

}

- (void) viewWillAppear: (BOOL) animado {

[superviewWillAppear: animação];

self.title = recipes.recipeName;

[photoButtonsetImage: recipes.recipeThumbnailImage forState: UIControlStateNormal];

[selfupdatePhotoButton];

[self.

tableView reloadData];

}

- (void ) setEditing: (BOOL) edição animado: (BOOL) animado {

[supersetEditing: editinganimated: animação];

[selfupdatePhotoButton];

}

- (void) {didReceiveMemoryWarning

[superdidReceiveMemoryWarning];

}

- (void) {viewDidUnload

}

# Pragma vista marca Tabela métodos

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

return1;

}

//Personalize o número de linhas na exibição de tabela

- (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: seção.

(NSInteger) {

return2;

> //Personalizar a aparência das células visualizar a tabela

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

staticNSString * CellIdentifier = @ "Cell ";

UITableViewCell * célula = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];

if (celular == nil) {

célula = [[[UITableViewCellalloc] initWithStyle: UITableViewCellStyleValue2reuseIdentifier: CellIdentifier] autorelease];

cell.

editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator;

}

... interruptor //Configure a célula

(indexPath.row ) {

case0:

cell.textLabel.text = @ "Nome";

cell.detailTextLabel.text = recipes.recipeName;

pausa ;

case1:

cell.textLabel.text = @ "Tempo d

Page   <<  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] >>
Copyright © 2008 - 2016 Leitura Educação Artigos,https://artigos.nmjjxx.com All rights reserved.