tags:

views:

114

answers:

2

At the start of my app, the status bar is hidden, due to the Info.plist setting called 'Status bar is initially hidden'. Later on I want to show the status bar using

[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];

but I get a warning saying that the function is deprecated. Does anybody know what the new function is?

~Thanks

A: 

setStatusBarHidden:withAnimation: is the new method, which takes a UIStatusBarAnimation instead of a BOOL, so you can choose what animation is used to hide the status bar.

Douwe Maan
A: 

It is:

- (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation

See the UIApplication class reference for more info.

If you are trying to write code for both iOS 3.x and iOS 4.x, you are going to run into a further issue that the new method is not available in the old iOS. See this question for further info.

William Jockusch