0

I have a UITableView Controller and when a row is selected, I want to add that row's recipe to NSMutableArray addedRecipesArray which is a property of AppDelegate. However, I can tell that no recipes are actually being added to that addedRecipesArray based on the NSLogs I have set up.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    recipe = [recipesArray objectAtIndex:indexPath.row];
    NSLog(@"You have added %@ to the shoppingList", recipe.recipeName);
    [[[self appDelegate]addedRecipesArray] addObject:recipe];

    NSLog(@"The shopping list now contains:");
    for (Recipe *selectedRecipe in [[self appDelegate]addedRecipesArray])
    {
        NSLog(@"%@", selectedRecipe.recipeName);
    }



}
user1657563
  • 237
  • 4
  • 13

0 Answers0