I would like to create a new viewController and pass data when creating the instance.
I have a dictionary with some data and you want to access this data as soon as the viewController is created.
I tried this:
myRecipe = [[RecipeCard alloc] init];
[myRecipe setRecipeItems: dictionary]
;
The problem is that setRecipeItems is fired before the view is loaded.
Ideally, I would like to do something like:
myRecipe = [[RecipeCard alloc] initWithData: dictionary];
But it did not work for me
thank
source
share