Why my button hide?

Discussion in 'iOS Programming' started by ryosaeb4, Apr 11, 2011.

  1. macrumors newbie

    Jul 23, 2008
    Hi to everybody

    I've a little problem on my iPad App for the popupControl.

    I've define in DetailView.h

    UINavigationBar *navigationBar;
    @property (nonatomic, retain) IBOutlet UINavigationBar *navigationBar;

    and in DetailView.m

    - (void)showRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem {
        // Add the popover button to the left navigation item.
        [navigationBar.topItem setLeftBarButtonItem:barButtonItem animated:NO];
        NSLog(@"You are in DetailView Portrait");
    - (void)invalidateRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem {
        // Remove the popover button.
        [navigationBar.topItem setLeftBarButtonItem:nil animated:NO];
        NSLog(@"You are in DetailView Landscape");

    I've do it for show a navigation button in my view only when the iPad is in Portrait mode, but sometime the button disappears...

    Are there other method to show a button only when the iPad is Portrait?
  2. macrumors 65816


    Dec 29, 2010
    Aartselaar // Antwerp // Belgium
    There is a special method build in, to check what orientation ur application is, then u can use your code :)
    A simple google search could fix ur problem.

Share This Page