Mike Keskinov
Mike Keskinov

Reputation: 11898

Xcode deprecated warning not always appears

It seems that deprecated warning in Xcode (6.3) appears only when method deprecated before Development Target. My development target is 7.0, base SDK is 8.3. Methods which were deprecated before iOS 7.0 gives me the warning, but not if the method deprecated in iOS 8.0. Example:

[self.mainController didAnimateFirstHalfOfRotationToInterfaceOrientation:UIInterfaceOrientationPortrait];
[self.mainController willAnimateRotationToInterfaceOrientation:UIInterfaceOrientationPortrait duration:1];

First line of the code above gives me warning (method deprecated in iOS 5.0)

Second line doesn't produce any warning (method deprecated in iOS 8.0)

I think this is incorrect, since I just missed the fact that method become deprecated in iOS 8.0, so real users (with iOS 8.3) of our app affected. If I had warning, I would know ahead.

Is this normal behavior or a bug?

Upvotes: 3

Views: 808

Answers (1)

matt
matt

Reputation: 535915

It seems that deprecated warning in Xcode (6.3) appears only when method deprecated before Development Target

Well, think about it:

  • Suppose your deployment target is iOS 7.

  • And suppose a method is deprecated in iOS 8.

  • And suppose you replace it with the new iOS 8 method.

Now the app will crash on iOS 7, because that new iOS 8 is a new iOS 8 method - it doesn't exist in iOS 7.

So if you are going to be backwards compatible over two systems, you will probably have to use at least some methods that are deprecated in the later system in order to run at all on the earlier system. Thus there is no point warning you about these. The bug would be the other way - if the compiler warned you about all of those!

so real users (with iOS 8.3) of our app affected

Probably not. "Deprecated" does not mean "broken" or "no longer works". It means "deprecated". The method continues to work. (Until it doesn't, but that hasn't happened yet.)

Upvotes: 6

Related Questions