您的位置:首页 > 其它

iphone viewdidLoad运行以及参数的传递。

2012-03-17 14:51 405 查看
问题: 有三个view,他们之间传递一个NSArray *NodeArray

IPadLoginViewController----》VedioContainerViewController-----》IpadTreeViewTestController

在 VedioContainerViewController的ViewDidLoad 中,若写成如下代码

IpadTreeViewTestController *ipadTvtc = [[IpadTreeViewTestController alloc] init];

ipadTvtc.view.frame = CGRectMake(0, 0, 500, 1024); ipadTvtc.NodeArray = self.NodeArray; self.ipadTreeViewController = ipadTvtc; [self.view addSubview:self.ipadTreeViewController.view]; [ipadTvtc release];

结果发现 NodeArray传递到IpadTreeViewTestController时,其数组元素的个数为0;

但如果 写成如下:

self.ipadTreeViewController = [[IpadTreeViewTestController alloc] init]; self.ipadTreeViewController.NodeArray = self.NodeArray; [self.view addSubview:self.ipadTreeViewController.view];结果发现 NodeArray传递到IpadTreeViewTestController时,其数组元素的个数不为0;

不知道这为什么?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: