objective c - Suppressing line specific XCode compiler warnings -


, I deprecated calls that are bugging me the same way. Is there a way to suppress the warning from the line? For example:

  if ([[UIApplication sharedApplication] respondsToSelector: @selector (setStatusBarHidden: withAnimation :)]) {[[UIApplication sharedApplication] setStatusBarHidden: Yes withAnimation: UIStatusBarAnimationSlide]; } Else {[UIApplication sharedApplication] setStatusBarHidden: animated yes: NO]; // causes the counter-alert alert}  

All I care about is that line. I do not want to stop the all exclusionary warnings. I would rather not have anything like that.

have been in some other situations where I wanted even though the compiler is fine, as a specific line for the flag generates an alert. I inevitably has handled the problem that I want to know your team and stop over sideways about the same line.

has posted an interesting solution. In short:

  @protocol UIApplicationDeprecatedMethods - (minus) setStatusBarHidden: (bool) animated hidden: (bool) Animated; @end  

  if ([[UIApplication sharedApplication] the answer: Tyler selector: @ selector (set status Brhard: Sathanimeshn :)) {[UIApplication sharedApplication] SetStatusBarHidden: Yes with Animation: UIStatusBarAnimationSlide]; } Other {ID & lt; UIApplicationDeprecatedMethods & gt; App = [UIApplication shared application]; [App Setstats Barhard: Yes Animated: No]; }  

Comments