Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Add UINavigationController to UIViewController using Interface builder

Hi all,

As I know how to add navigation controller to viewController using coding but by using Interface Builder I am not able to do it.


Here is the code how I am coding.


VC1 *vController = [[VC1 alloc]init];



UINavigationController *nav = [[UINavigationControlleralloc] initWithRootViewController:vController];


[vController setModalPresentationStyle:UIModalPresentationFullScreen];



aNAv.navigationBarHidden = YES;


[aNAv presentModalViewController:nav animated:YES];


[nav release];


[vController release];


and these how I am using Interface Builder


User uploaded file

MacBook Pro, Mac OS X (10.6.7)

Posted on Jul 7, 2011 10:13 PM

Reply
1 reply

Jul 8, 2011 12:19 AM in response to anand84

Don't init your navigationController, the xib connection do that automatically. The only line is that :


[self.window addSubview:navigationController.view];


And you must connect navigationCOntroller to your navigationController.Then you must write the nib in the SettingsViewController. (the nib name is the name of you xib).

Add UINavigationController to UIViewController using Interface builder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.