在以前的viewController中设置时,NSMutableArray返回null

时间:2012-04-24 13:55:30

标签: iphone nsmutablearray

我在之前的viewController中设置了一个viewController数组,但它在viewController中返回null。我也设置了它的属性。

上一个viewController:

controller.arrGUID = arr;

ViewController

@property(nonatomic,retain)NSMutableArray *arrGUID;  //synthesized as well.  

在viewController中使用arrGUID返回null。

2 个答案:

答案 0 :(得分:0)

NextViewController *controller = [[NextViewController alloc]initWithNibName:@"NextViewController" bundle:nil];
controller.arrGUID = arr;// where arr is previous controller array.
[self.navigationController pushViewController:controller animated:YES];
[controller release];

也是nextviewcontroller的viewdidload方法中的nslog。

它会帮助你。

答案 1 :(得分:0)

我认为你有问题

试试这个

 controller.arrGUID = [arr retain];
相关问题