Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm happy to be wrong about this, but it looks to me like when you call <code>tableView:didSelectRowAtIndexPath:</code> you set the recipe (ricetta?) in the <code>DetailViewController</code> but I don't see any instruction to tell the <code>DetailViewController</code> to display the new recipe.</p> <p>You have code to update your <code>DetailViewController</code> in <code>viewWillAppear:animated:</code> but this will only happen when the view is going to appear - if your view has already appeared this method won't be executed.</p> <p>I suggest you create a method in <code>DetailViewController</code> called <code>updateRicetta</code> which will look something like:</p> <pre><code>- (void)updateRicetta { lblTitolo.text = [ricetta objectForKey:NAME_KEY]; ingredientiTxtView.text = [ricetta objectForKey:INGREDIENTS_KEY]; descrizioneTxtView.text = [ricetta objectForKey:DESCRIPTION_KEY]; UIImage *img = [UIImage imageNamed:PHOTO_KEY]; fotoImgView.image = img; } </code></pre> <p>You could then call this from tableView:didSelectRowAtIndexPath: -</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { detailViewController.ricetta = [self.ricette objectAtIndex:indexPath.row]; [detailViewController updateRicetta]; } </code></pre> <p>As to the returning <code>nil:</code> my guess is that when <code>viewWillAppear:animated:</code> is called you have not yet selected an entry and therefore ricetta has not yet been set in the <code>DetailViewController</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload