About navigation controller in view controller?

UIViewController has navigationController property that is handled by the framework and it points to the parent UINavigationController if the view controller in question has one.

Up vote 0 down vote favorite share g+ share fb share tw.

In the appdelagate, we have a UINavigationController and the view controllers as well. Then in it we can initialize the navigation controller with the root view controller. And I understand why need them too.

However, in the sample code of my reference book(iPhone SDK Application Development, author: Jonathan Zdziarski), all view controller classes were added with a navigation controller as property, while they seem to be never used. So what is the meaning of having them as property in view controller classes? E.

G @interface XYZViewController: UIViewController { UITextView *textView; UIButton *button; ..... ..... UINavigationController *navigationController; } -(void)... ..... ... @end One more question: All UIViewController instances can have the property "navigationItem" once they are navigated. So what do this navigationItem refer to? Does it refer to the navigation controller that is navigating the view controller?

Iphone ios uiviewcontroller uinavigationcontroller link|improve this question asked Oct 20 '11 at 9:32user988988424 40% accept rate.

UIViewController has navigationController property that is handled by the framework and it points to the parent UINavigationController if the view controller in question has one. Check the documentation for more info: developer.apple.com/library/ios/#DOCUMEN... The same documentation will tell you that navigationItem is a UINavigationItem object that represents a view controller in the navigation bar. You can customise its appearance, like title, prompt, back button behaviour, etc. That said, I have no idea why your book adds a navigationController property to UIViewController subclasses.

It was added in iOS 2.0, a long time ago already... Anyway, you shouldn't need to add it, as it's provided in UIViewController class.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions