• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Pushed nav controller not displaying?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pushed nav controller not displaying?


  • Subject: Pushed nav controller not displaying?
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Tue, 14 Jan 2014 15:37:39 -0500

I need another brain on this one.

I have an iOS iPhone ARC app (only supports landscape in the General
settings) that I've started that uses a Storyboard for a view controller
that isn't the initial.

In my app delegate I'm doing this:

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]
bounds]];

    ScanViewController *viewController = [[ScanViewController alloc] init];

    UINavigationController *navController = [[UINavigationController alloc]
initWithRootViewController:viewController];

    [self.window setRootViewController:navController];

    navController.navigationBar.tintColor = [UIColor colorWithRed:0.0
green:0.0 blue:0.0 alpha:1.0];

    self.window.backgroundColor = [UIColor redColor];

    [self.window makeKeyAndVisible];

    return YES;

}

This is working fine. ScanViewController= UITableViewController.

Later on, I want to push another view controller. When I do, the current
view controller view shifts to the left, but I never see the pushed view
controller appear. From the ScanViewController:

ViewController *viewController = [[ViewController alloc] init];

[[self navigationController] pushViewController:viewController animated:YES
];


From within the ViewController:


- (void)viewDidAppear:(BOOL)animated {

    NSLog(@"ViewController appeared, frame: %@, %@",

        NSStringFromCGRect(self.view.frame),

        NSStringFromCGRect(self.view.bounds));

}


*frame: {{0, 0}, {320, 568}}, {{0, 0}, {320, 568}}*


The values seem fine but all I see is the red background of the window. The
code in the viewDidLoad works fine - I'm just not seeing any UI from the
Storyboard.


Is there something that I need to wire/connect to get the view controller's
view to display? Something in the storyboard inspectors? It is not selected
as the Initial View Controller. I also am not using AutoLayout. In the
Identity Inspector the Class is set to ViewController which should be
correct.


I must be missing something daft...


Thanks for your time,

Eric
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Pushed nav controller not displaying?
      • From: "Eric E. Dolecki" <email@hidden>
  • Prev by Date: Re: UILabel's sizeToFit - only on re-used cells
  • Next by Date: Re: RSA and libcrypto
  • Previous by thread: Re: UILabel's sizeToFit - only on re-used cells
  • Next by thread: Re: Pushed nav controller not displaying?
  • Index(es):
    • Date
    • Thread