SplitViewController
Can I call detailViewController
methods or get attributes declared as IBOutlets
by me in the class, from another rootViewController
that I have created?
I have this hierarchy of rootControlViews
:
[RootViewController]
[Cell 1] -> [Cell1RootViewController] (push Cell1RootView... into the navController]
Only one DetailViewController
with an IBOutlet
declared object (and synthethised) called object
.
I select the [Cell 1]
, So I am now inside Cell1RootViewController
. How can I call the object
declared in 开发者_开发问答DetailViewController
from here?.
I have tried declaring it inside Cell1RootViewController
and tried linking it by reference outlet with the one that is inside DetailViewController
, but it didn't work.
If you have a SplitViewController
, then you have a MasterView
and a ControllerView
(that extends/implements TableDataSource
and TableDelegate
protocols).
If you wanted to have several ControllerViews
because of something, and wanted to call MasterView
methods when inside of any ControllView
of yours, you should have an INIT method like this:
- (id) initWithMasterView: (MasterView *) theMaster, ....otherOptionsYouWant{
self = [super init]
if (self){
myMasterInstance = theMaster;
//other initializations you want here
}
return self;
}
精彩评论