2

I am hiding the Status bar with the below code and it gives me a memory warning level1 . It does nothing to the app itself during the memory warning but I do not like to have such things happening. Is there somthing I am doing wrong? or and con someone confirm a IOS bug? Not a huge deal just bothering me , so any info is greatly appreciated. Thanks!

[[UIApplication sharedApplication] setStatusBarHidden:YES   
withAnimation:UIStatusBarAnimationSlide];
FreeAppl3
  • 858
  • 1
  • 15
  • 32

1 Answers1

0

Try this

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    { 
        if([[UIApplication sharedApplication] respondsToSelector:@selector(setStatusBarHidden:withAnimation:)]) {
                [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO]; 
            } 
            else { 
                id<UIApplicationDeprecatedMethods> app = [UIApplication sharedApplication];
                [app setStatusBarHidden:YES animated:NO];
            }
}

and declare in your .h

@protocol UIApplicationDeprecatedMethods
- (void)setStatusBarHidden:(BOOL)hidden animated:(BOOL)animated;
@end

Hope it helps..

P.J
  • 6,547
  • 9
  • 44
  • 74