SplitViewController

时间:2011-05-05 17:22:08

标签: ipad

感谢先进。 我想知道我是否可以调用detailViewController方法或者从我创建的另一个rootViewController获取在类中声明为IBOutlets的属性。让我解释一下:

我有rootControlViews的这个层次结构:

[RootViewController的]     [单元1] - > [Cell1RootViewController](将Cell1RootView推送到navController中)

只有1个带有IBOutlet声明对象(和synthethised)的DetailViewController称为“对象”

我选择[Cell 1],所以我现在在Cell1RootViewController里面。如何从这里调用DetailViewController中声明的“对象”?

我已经尝试在Cell1RootViewController中声明它并尝试通过引用插座将其链接到DetailViewController内部的那个,但我不能没有成功...

谢谢大家!

1 个答案:

答案 0 :(得分:2)

好吧,几周前我解决了这个问题,但工作正常,没有时间发布我的解决方案。 因此,我不清楚我试图解释什么。 如果你有一个SplitViewController,那么你有一个MasterView和一个ControllerView(扩展/实现TableDataSource和TableDelegate协议)。 如果你想要有几个ControllerViews,并希望在你的任何ControllView内部调用MasterView方法,你应该有一个像这样的INIT方法:

- (id) initWithMasterView: (MasterView *) theMaster, ....otherOptionsYouWant{
       self = [super init]
       if (self){ 
               myMasterInstance = theMaster;
               //other initializations you want here
       }
       return self;
}

我不是编程语言的新手,但是客观C和Iphone开发中的这些东西似乎比它更复杂。