3
我想创建一个新的viewController并在实例化时传递数据。使用参数创建视图控制器
我有一个包含一些数据的字典,想在创建viewController后立即访问这些数据。
我已经试过这样:
//create the recipe
myRecipe = [[RecipeCard alloc] init];
//create a dictionary here...
//call the setRecipeItems method of the recipe I have created
[myRecipe setRecipeItems: dictionary]
;
的问题是,认为前setRecipeItems火灾没有负载。
理想情况下,我想这样做:
myRecipe = [[RecipeCard页头] initWithData:字典]。
但是,这并没有为我工作
感谢
写这之后,我想我可以只设置与第一种方法的数据,然后将这些数据在我viewDidLoad中后调用一个方法,但我很好奇,如果这是可能的,所以我并没有删除我正在尝试做的 – 2011-01-14 20:10:40