开发者

SplitViewController

开发者 https://www.devze.com 2023-03-02 22:15 出处:网络
Can I call detailViewController methods or get attributes declared as IBOutlets by me in the class, from another rootViewController that I have created?

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消