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

iPhone kjernedata Tutorial Part 1

];

Oppskrifter * oppskrifter = (Oppskrifter *) [NSEntityDescription insertNewObjectForEntityForName: @" oppskrifter "inManagedObjectContext: self.managedObjectContext];

addRecipeView.recipes = oppskrifter;

UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController: addRecipeView];

[self.

navigationController presentModalViewController: navController animerte: YES];

[addRecipeView utgivelsen];

}

#pragma mark -

#pragma mark tabellvisning metoder

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

< p> Retur [[fetchedResultsController seksjoner] telle];

}

- (NSInteger) Tableview: (UITableView *) Tableview numberOfRowsInSection: (NSInteger) section {

id sectionInfo = [[fetchedResultsController seksjoner] objectAtIndex: seksjonen];

retur [sectionInfo numberOfObjects];

}

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

statisk NSString * CellIdentifier = @ "Cell";

UITableViewCell * celle = [Tableview dequeueReusableCellWithIdentifier: CellIdentifier];

if (celle == null) {

celle = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier] autorelease];

}

NSManagedObject * managedObject = [fetchedResultsController objectAtIndexPath: indexPath] ;

cell.

textLabel.text = [[managedObject valueForKey: @ "recipeName"] beskrivelse];

retur celle;

}

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

RecipeDetailViewController * recipeDetailView = [[RecipeDetailViewController alloc] initWithStyle: UITableViewStyleGrouped];

Oppskrifter * oppskrifter = (Oppskrifter * ) [fetchedResultsController objectAtIndexPath: indexPath];

recipeDetailView.recipes = oppskrifter;

[self.

navigationController pushViewController: recipeDetailView animerte: YES];

}

- (void) Tableview: (UITableView *) Tableview commitEditingStyle: (UITableViewCellEditingStyle) editingStyle forRowAtIndexPath: (NSIndexPath *) indexPath {

if (editingStyle == UITableViewCellEditingStyleDelete) {

NSManagedObjectContext * sammenheng = [fetchedResultsController managedObjectContext];

[sammenheng deleteObject: [fetchedRes

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