Search code examples
iphoneiosobjective-cxcodestatusbar

Status Bar still appearing in iOS 7 despite correct PList settings


I've just upgraded to XCode 5 and iOS 7. I've read all the suggestions I can find, but still getting the status bar appearing over the top of my apps.

I've tried setting View controller-based status bar appearance to NO in my plist:

enter image description here

I've tried adding:

- (void)viewDidLoad
{
    // …
    if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
        // iOS 7
        [self prefersStatusBarHidden];
        [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
    } else {
        // iOS 6
        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
    }
    // …
}

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

to my root view controller.

I don't know what else to try. Am I missing something obvious?

UPDATE

I've found that the status bar is only present on a couple of targets, while other targets running the same code don't have the status bar. I've checked all their plists... The only difference with the ones showing the status bar are that they display an advert bar at the top of the screen... I wonder if this could have something to do with it?


Solution

  • I ended up deleting the plist file and copying one from another target that did work, and then changing the necessary values. The lists were identical, however this appeared to fix it. I had already tried clean building, reseting the simulator etc, so I guess it was a bug in the plist/xcode.