开发者

Objective-C: make reference to class that created class

开发者 https://www.devze.com 2023-03-22 14:17 出处:网络
Being mysef a newbie to Obj-C I´m having some troubles creating a navigation scheme. Well, I have this NavigationController with its UIViewController (let\'s call it mainView).

Being mysef a newbie to Obj-C I´m having some troubles creating a navigation scheme.

Well, I have this NavigationController with its UIViewController (let's call it mainView).

Inside the ViewController I load another UIViewController (let's call it dynaView, I add it with insertSubview:dynaView.view).

The Controller for dynaView has a NavigationController pushViewController to another ViewController, but since the NavigationController is related to mainView, using self.Navigat开发者_Python百科ionController pushViewController won't do the trick, so I was wondering how can I make reference to the NavigationController of the mainView instance that created dynaView?

Something like self.parent.NavigationController...

Anyone who can help me :) ?


UIView has a superview property; UIViewController has a parentViewController property. One of those is what you're looking for.

0

精彩评论

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