Cannot Hide Status Bar


It seems pretty straight forward. I added the last two lines of the following code but I am still seeing a status bar. I also changed the key “Status bar is initially hidden” to value “YES”. Still there. What am I missing? Thanks in advance.


[code]- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

[[UIApplication sharedApplication] setStatusBarHidden:YES


Are you targeting iOS7? I have the same issue and when I Google the problem it seems there is a change on iOS7 that affects this.

One of the suggestions here may help…


Yes, iOS7. Good call. I will mess around with some of the suggestions. Thanks AndyWW.


Let me know if you mange to fix it. I’m soldiering on for now and ignoring it but I’d like to know how to fix it up at some point.


Add and change the key “View-Controller Based Status Bar Appearance” to value “NO”. The app now responds to the code we added in HypnosisterAppDelegate.m (including the Fade Animation).


Ah yes - much better!


Another way to do it, at the ViewController level:

-(BOOL)prefersStatusBarHidden { return YES; }



Craig - how and where do i implement that new method? and do i need to call it from anywhere in particular?


Well, it overrides a UIViewController method, so it would go in your view controller. And it would automatically be called as part of the view controller’s setup.

Unfortunately, this app doesn’t have a View Controller.

2014-02-22 16:47:56.288 Hypnosister[14132:70b] Application windows are expected to have a root view controller at the end of application launch

I guess my answer doesn’t help for this chapter. :unamused: