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;
不知道这为什么?
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;
不知道这为什么?
相关文章推荐
- ReportView报表实现带参数存储过程创建报表以及为rdlc传递参
- ReportView报表实现带参数存储过程创建报表以及为rdlc传递参数
- 如何在命令行下运行php脚本以及传递参数
- SpingMVC ModelAndView, Model,Control以及参数传递
- SpingMVC ModelAndView, Model,Control以及参数传递
- ReportView如何使用构造SQL语句带参数的存储过程创建报表以及为rdlc传递参数
- IPHONE开发 在VIEW之间传递参数
- SpringMVC(5):MVC的参数传递详解与示例(简单类型数据、ModelAndView、Model 、 POJO 以及 Map)
- iPhone view 之间的参数传递
- Mybatis深入-如何使用传递不同类型的参数(以及等量替换符号的使用)
- WebView的配置和网页参数传递
- @Param注解在Mybatis中的使用 以及传递参数的三种方式
- viewDidUnload,viewDidLoad,viewWillAppear,viewWillDisappear的作用以及区别
- android中利用webview调用网页上的js代码 Java代码调用js并传递参数
- ios开发UI篇—在ImageView中添加按钮以及Tag的参数说明
- 请写出并说明如何在命令行下运行PHP脚本(写出两种方式)同时向PHP脚本传递参数?
- 运行scrpay crawl时传递参数
- Sturts2传递传递参数3中方法以及获取
- C语言函数参数以及函数参数的传递
- Code19 使用C#实现如何在运行时传递参数给水晶报表