Sunday, December 15, 2013

About self.navgationController to nil problems.

About self.navgationController to nil problems.

FlipsideViewController * controller = [[FlipsideViewController alloc]
initWithNibName: @ "FlipsideViewController"
bundle: nil];

CATransition * animation = [CATransition animation];
[Animation setDuration: 0.8];
[Animation setType: kCATransitionPush];
[Animation setSubtype: kCATransitionFromLeft];
[Animation setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionDefault]];


[Self.navigationController pushViewController: controller animated: YES]; / / this line of code self.navigationController variable is not defined, because there is no response after execution

[Self.navigationController.view.layer addAnimation: animation forKey: nil];


I want to know is what I want on this self.navigationController dragged into a NavigationBar controls XIB in it?
Read quite a few articles on the Internet saying this, but they did not let me fully understand this navigationController in the end is what is said and then create a control on this variable associated with it?
How do associate it?
Reply:
Novice Answer:

To add a navigationController control and declare iboutlet
file in mainXib
nav is connected to delegate control. So as to function as navigation controls
Reply:
That is a navigation bar. The role of many.

You use the navigation bar, it is necessary to add a navigationController control in XIB file inside. Remember to use the commission
Reply:
self.navigationController refers to your current navigationController class. Depends on your self is the role in which the class.

H file to see the inside of your self is how to write it.

You can create navigationController with xib, you can use the code. As long succession UINavigationController
Reply:
Thank you both reply:
Creating the code is doing.

UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController: self.mainViewController];
[Self.window addSubview: nav.view];

After following this execution when
[Self.navigationController pushViewController: controller animated: YES];


Enter this value under GDB Why is not there.
(Gdb) print self.navigationController
There is no member named navigationController.
Reply:
Above code should be no problem, when under gdb print object I would use po self.navigationController
Reply:
When you push navigationController push viewcontroller is after your self. Self.navigationController not empty the

Reply:
It is necessary that you create, and if not, then the project template.

No comments:

Post a Comment