1

I'm working on an app which was made in some older version of Xcode, it is currently having min supported version iOS 7.0

+[UIStatusBar frameForStyle:orientation:]: unrecognized selector sent to instance

I have set the break point, but unable to find the issue.

Cœur
  • 37,241
  • 25
  • 195
  • 267
zaheer
  • 893
  • 13
  • 27

2 Answers2

0

Guys thanks for your responses and interest, Accidentally I came to know that, I had set the UIStatusBar hidden, while there was a MPVloumeView added to view, Whenever I tried to change the volume, It crashed the application. According to another SO answer, the MPVloumeView should be in the first UIWindow of application.

I just added another MPVloumeView in first window, and made it invisible

MPVolumeView* mpView=[[MPVolumeView alloc]initWithFrame:CGRectMake(0, 0, 1, 1)];
[mpView setTintColor:[UIColor clearColor]];
mpView.alpha=0.01;
{
    NSArray *windows = [UIApplication sharedApplication].windows;
    if (windows.count > 0) {
        [[windows objectAtIndex:0] addSubview:mpView];
    }
}
zaheer
  • 893
  • 13
  • 27
-1

There is no class reference for UIStatusBar, so you are calling a class method on an unknown class.

What are you trying to do with the status bar? You can edit it through the plist or through UIApplication like [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];

It does look like (from looking at code on GitHub) that UIStatusBar.h was part of UIKit at some point. Maybe it is a private class that we should not really have access to?

Josh Gafni
  • 2,831
  • 2
  • 19
  • 32
  • 1
    App is not calling it specifically. Some other UI change in status bar is causing it to be called and it throws exception there. – zaheer Jan 22 '15 at 05:19
  • Try turning zombies on and see if you can trace back to why the crash is happening. If you need help sorting through the output, try pasting it here. – Josh Gafni Jan 22 '15 at 05:21
  • Thanks, I try it with zombies. – zaheer Jan 22 '15 at 05:24