Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8820659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:39:47+00:00 2026-06-14T05:39:47+00:00

I have a little problem using UINavigationController . I have a first ViewController (called

  • 0

I have a little problem using UINavigationController.

I have a first ViewController (called LaunchViewController) with a navigation controller (that works fine), I can use pushViewController to display a second ViewController (called SettingViewController) and it works fine too, but when (from the first view controller) I want to display a third ViewController (called IPhonePage), after the view is displayed, and when I want to use the navigation controller in my IPhonePage, the navigation controller is null...

Don’t know if my question is clear, I can show you the code I use to do that :

AppDelegate.m :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    LaunchViewController* controller = [[LaunchViewController alloc] initWithNibName:@"LaunchViewController" bundle:nil];
    _navigationController = [[UINavigationController alloc] initWithRootViewController:controller];
    _navigationController.navigationBar.tintColor = [UIColor blackColor];
    [self.window setRootViewController:_navigationController];
    [self.window makeKeyAndVisible];

    return YES;
}

LaunchViewController.m :

- (IBAction)showSettings:(id)sender {
    SettingViewController* controller = [[SettingViewController alloc] initWithNibName:@"SettingViewController" bundle:nil];
    [self.navigationController pushViewController:controller animated:YES];
}

This works fine (I can access the navigation controller in SettingViewController)

But this,

LaunchViewController.m :

- (void)ShowPageWithIMDevicePage:(id<IMDevicePage>)page {
    [self.navigationController pushViewController:(UIViewController*)page animated:YES];
}

The page is created by :

- (id<IMDevicePage>)CreatePage {
    return [[IPhonePage alloc] init];
}

And my IPhonePage class looks like this,

IPhonePage.h :

@interface IPhonePage : UIViewController <IMDevicePage>

IPhonePage.m :

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"navigation controller = %@", self.navigationController);
}

And the log displays navigation controller = (null), e.g. I don’t have access to the navigation controller.

I really hope someone’s gonna understand what I want, I know it’s a bit complicated but it’s for a specific reason that I make that this way.

Thanks ! Cheers 🙂

EDIT
Actually it happens because I create the page, and I set different things like the title, content and toolbar, and then I call pushViewController, the strange thing is that I have a method that sets the content of the UIViewController

IPhonePage.m

- (void)SetContentWithIMDeviceControl:(id<IMDeviceControl>)content {
    self.view = (UIView*)content;
}

And after that it doesn’t call anymore my viewDidLoad method (any clue ?).
Also I have a method which role is to add a toolbar at the bottom of the view

- (void)SetApplicationBarWithIMDeviceApplicationBar:(id<IMDeviceApplicationBar>)appBar {
}

At first I wanted to use the navigation controller to set this toolbar, but because this method is called before the pushViewController method, the navigation controller is nil.
Is there any possibility to set manually the navigation controller without calling pushViewController ? Or any other way to add a toolbar ? Like declaring a toolbar and adding it as a subview maybe ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:39:48+00:00Added an answer on June 14, 2026 at 5:39 am

    Try something like :

    - (void)ShowPageWithIMDevicePage:(id<IMDevicePage>)page {
        YourDelegate* delegate = (YourDelegate*)[[UIApplication sharedApplication] delegate];
        IPhonePage* pageVC = (IPhonePage*)page;
        [delegate.navigationController pushViewController:pageVC animated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem using Tabs with Views. First I just copied the
Hello I am using Grails 2.1 and I have a little problem I can't
I have a little problem about using jQuery (I really do not know jQuery
I'm using ActionBarSherlock and have a little problem. In the Fragment Tabs example, there
I have a little problem about Google Maps. I'm using Geocoding (xml) for getting
I have a little problem with a query. I'm selecting data using the between
I have a little problem with adding actions on UITabBarItems. I am not using
I have a little problem, probably easy for you. Im using Core Data. I
Hi all im using a sqlite helper class, but i have a little problem
i have little problem in using my application application having msaccess database if i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.