Hiding the status bar


#1

I wasn’t able to get the entire status bar hidden right the app starts up. With the code in the book, it was only hidden after the app had already started running.

You can hide it fully on startup by editing the “Hypnosister-Info.plist” file for your app.

You need to add a new key on the left: UIStatusBarHidden with the type of Boolean and the value: YES (or make sure the checkmark is checked).

This will completely hide the status bar upon launch.


#2

I think this should have been shown either as you have mentioned. Putting the call in the “application:didFinishLaunchingWithOptions” method ensures it will happen…well…after the application finished launching. I wonder if there is another method that occurs much earlier. I could not find one but it might be interesting to know because I would rather do things programmatically because Apple will probably move the area where you set it and it will take a while to find at a later date.


#3

Further to this topic…

The code (on pg. 124 in the print edition) adds to [color=#008000]application:didFinishLaunchingWithOptions:[/color] the following line:

In the debugger, I note that [color=#008000][UIApplication sharedApplication][/color] has the same value as the [color=#008000]application[/color] parameter to the function, as I would expect.

I can understand that this line is universal, and can be inserted anywhere in the code (because of the accessibility of [color=#008000]+(application *)sharedApplication[/color],) but in this particular place wouldn’t it be just as appropriate to write:

instead, and not pay the overhead of the gratuitous re-query of the singleton? Or to ask my question more generally:

Is there any case where the [color=#008000]application[/color] parameter of [color=#008000]application:didFinishLaunchingWithOptions:[/color] does NOT have the same value as [color=#008000]+(application *)sharedApplication[/color]?