Recipe example
RecipeAddViewController *addController = [[RecipeAddViewController alloc]
initWithNibName:@"RecipeAddView" bundle:nil];
addController.delegate = self;
Recipe *newRecipe = [NSEntityDescription
insertNewObjectForEntityForName:@"Recipe"
inManagedObjectContext:self.managedObjectContext];
addController.recipe = newRecipe;
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:addController];
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
[addController release];
presentModalViewController and initWithRootViewController are retaining their arguments and taking ownership. Then two objects are released, proving that someone took the ownership. So in general how do I know which message will in result take ownership, to release the corresponding objects?
newRecipe is not released because the life-cycle of managed object is non of my business, is this statement correct?
UPD: sorry for #2 the answer would be that it's retained by addController then released in dealloc of addController.