Note that there are some explanatory texts on larger screens.

plurals
  1. POiphone UIViewController base subclass not showing view in UINavigationController
    primarykey
    data
    text
    <p>I had the idea to subclass UIViewController as a base class for my subsequent controllers with the purpose of adding a "logout" button to the UINavigationController in my app delegate.</p> <pre><code>//MyAppDelegate.m @synthesize navigationController; //UINavigationController //-didFinishLaunchingWithOptions... [self.window addSubview:navigationController.view]; ... </code></pre> <p>In my MainWindow.xib I have a NavigationController attached to.. navigationController with <strong>DashboardViewController</strong> as its root view controller.</p> <pre><code>//BaseLogoutViewController.m - (void)loadView { UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Logout", @"") style:UIBarButtonItemStyleBordered target:self action:@selector(logoutPressed)]; self.navigationItem.rightBarButtonItem = addButton; [addButton release]; [super loadView]; } // -(void)logoutPressed callback implemented // viewDidLoad, didRecieveMemoryWarning, dealloc implemented //DashboardViewController.h @interface DashboardViewController : BaseLogoutViewController { } </code></pre> <p><img src="https://i.stack.imgur.com/f7IkS.png" alt="DashboardViewController : UIViewController"><br> <strong>DashboardViewController : UIViewController</strong> </p> <p><img src="https://i.stack.imgur.com/M8JQb.png" alt="DashboardViewController : BaseLogoutViewController"><br> <strong>DashboardViewController : BaseLogoutViewController</strong> </p> <p>The good news is it does show the logout button, but the dashboard does not show it's own view. <strong>BaseLogoutViewController</strong> does not have a Nib of its own. My question is, how come when I subclass BaseLogoutViewController it no longer shows my <strong>DashboardViewController's</strong> view?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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