开发者

how to load UINavigationController from Uiviewcontroller

开发者 https://www.devze.com 2023-03-09 15:52 出处:网络
I want to load my UINavController from my UIViewController. My interface details is here. @interface ContactUs : UIViewController {

I want to load my UINavController from my UIViewController. My interface details is here.

@interface ContactUs : UIViewController {

    IBOutlet UIWindow *window;

    IBOutlet UINavigationController *navController;

}

@property (nonatomic,retain) IBOutlet UINavigationController *navController;

@end

and in implementation ..

@synthesize window;

@synthesize navController;

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.

 -(void)viewDidLoad {

  [window addSubview:navController.view];

  [window开发者_StackOverflow社区 makeKeyAndVisible];

    [super viewDidLoad];
    

        NSLog(@":::::::::::::::::::");

}
 

But unfortunate my UINavigationController is not loading. I am seeing a blank windows is appearing.


@interface ContactUs : UINavigationViewController {

      IBOutlet UIWindow *window;

      IBOutlet UITextView *textView;
      IBOutlet UIButton *button;

       }

   // Add properties to the all outlets //

     -(IBAction) buttonpressed: (id) sender;

And in the implementation - write the code for buttonpressed and you can make use that for whatever your goals are.


If you want to use the Navigation View controller over the View controller .. Why not use the UINavigationController ?

        @interface ContactUs : UINavigationViewController {

          IBOutlet UIWindow *window;

          // IBOutlet UINavigationController *navController; // You do not need this. 

         }
0

精彩评论

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