Note that there are some explanatory texts on larger screens.

plurals
  1. POUINavigationController pushViewController in viewDidLoad not working
    primarykey
    data
    text
    <p>I have the following code in my <code>AppDelegate</code>:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @class PersonalDiarySystemViewController; @interface PersonalDiarySystemAppDelegate : NSObject &lt;UIApplicationDelegate&gt; { UIWindow *window; PersonalDiarySystemViewController *viewController; UINavigationController *navigationController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet PersonalDiarySystemViewController *viewController; @property (nonatomic, retain) UINavigationController *navigationController; @end #import "PersonalDiarySystemAppDelegate.h" #import "PersonalDiarySystemViewController.h" @implementation PersonalDiarySystemAppDelegate @synthesize window; @synthesize viewController; @synthesize navigationController; #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Set the view controller as the window's root view controller and display. self.window.rootViewController = self.viewController; navigationController = [[UINavigationController alloc] initWithRootViewController:self.window.rootViewController]; navigationController.navigationBar.tintColor = [UIColor colorWithRed:217.0/255 green:33.0/255 blue:0 alpha:1]; navigationController.navigationBarHidden = YES; [self.window addSubview:navigationController.view]; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p>My rootviewcontroller tries to load another viewcontroller into the navigation controllers stack in its <code>viewDidLoad</code> method but for some reason the view is not getting pushed:</p> <pre><code>-(void) viewDidLoad{ lvc = [[LoginViewController alloc] init]; //lvc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [lvc setDelegate:self]; //[self presentModalViewController:lvc animated:YES]; [self.navigationController pushViewController:lvc animated:YES]; } </code></pre> <p>I'm getting no errors so not sure whats going on...using <code>presentModalViewController</code> works...so really am confused!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload