Hi there.
Im rather new to Objective-C and objective oriented programming. Ive tried to teach myself through books, but I seem to miss a basic concept here.
I think my problem is best explained through an example.
Im trying to create a UINavigationController based application with some subviews. I want to use the toolbar, thats provided with the UINavigationController, but I do not want it to show on all subviews. Just some of them.
Is start with the basic class testAppDelegate.m/.h, create an instance of the UINavigationController class with UINavigationController = *navigationController in that class. Now I add views and a navigationBar and everything works fine.
The toolbar isnt showing yet, as it is hidden by default. If I change that via navigationController.toolbarHidden = NO then I see the toolbar, but I see it all the time.
So I create a subclass of UIViewController named myViewController. There I use the viewWillAppear Method to show the toolbar, when the view is pushed. But how do I do that. myViewController cannot access the navigationController created in testAppDelegate.
Any help for a newb?
My first instinct was to create a method in testAppDelegate that sets navigationController.toolbarHidden = NO. That works fine, but only if I call the method from within the class (via self). If I call the method from myViewController, the App crashes.
Im rather new to Objective-C and objective oriented programming. Ive tried to teach myself through books, but I seem to miss a basic concept here.
I think my problem is best explained through an example.
Im trying to create a UINavigationController based application with some subviews. I want to use the toolbar, thats provided with the UINavigationController, but I do not want it to show on all subviews. Just some of them.
Is start with the basic class testAppDelegate.m/.h, create an instance of the UINavigationController class with UINavigationController = *navigationController in that class. Now I add views and a navigationBar and everything works fine.
The toolbar isnt showing yet, as it is hidden by default. If I change that via navigationController.toolbarHidden = NO then I see the toolbar, but I see it all the time.
So I create a subclass of UIViewController named myViewController. There I use the viewWillAppear Method to show the toolbar, when the view is pushed. But how do I do that. myViewController cannot access the navigationController created in testAppDelegate.
Any help for a newb?
My first instinct was to create a method in testAppDelegate that sets navigationController.toolbarHidden = NO. That works fine, but only if I call the method from within the class (via self). If I call the method from myViewController, the App crashes.