I need to change the color of status bar in my app.I'm using the code below
- (void)viewDidLoad {
    [super viewDidLoad];
     ....
    [self setNeedsStatusBarAppearanceUpdate];
}
-(UIStatusBarStyle)preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}
but this cause my app to crash.
EXC_BAD_ACCESS Error
It is sometimes produce memory warning.
What is the best way to handle this ?
 
    