Recently my app was getting crashed on IOS8 because i have used an API which is only available for IOS 9 and above. I am wondering is there anyway to check the whole project and find out if I am using any API which is not available for the current development target. Something like the warnings for the deprecated APIs. Thanks.
Asked
Active
Viewed 364 times
1
-
If you intend to support iOS 8, is there a reason you're using the iOS 9 SDK? If you compile with the iOS 8 SDK, you won't be able to call any iOS 9 functions. Or are you supporting both and trying to only use iOS 9 support when actually running in iOS 9? – user1118321 May 15 '17 at 03:31
-
I ment to say if i have used any api unintentionally. Because compiler doesn't show any waring or something. eg I have used this method `-[NSUserActivity expirationDate]` now NSUserActivity class is available in IOS 8 but `expirationDate` method is only available in IOS 9. Compiler don't show any warning. I found it when QA reported. So now i just want to double check in my app if i have missed anything. – Bilal May 15 '17 at 04:30
1 Answers
1
In order to tell the compiler you want to support an earlier OS, you need to set the SDK to that earlier OS's SDK. If you set the SDK to iOS 8, then any time you use functionality from a later OS, you should get a compiler error.

user1118321
- 25,567
- 4
- 55
- 86
-
Can you please tell me how to change the Base SDK? Dropdown is only showing the the latest SDK. I found this http://stackoverflow.com/questions/12728517/changing-the-base-sdk-in-xcode but accepted answer is not to do that. – Bilal May 15 '17 at 05:17
-
Changing the deployment target as suggested in the answer above will not give you compiler warnings. I'm not sure how to install older SDKs as I've never had to do that. According to [the second answer on this question](http://stackoverflow.com/questions/7320235/is-there-a-way-to-install-older-ios-sdks-in-xcode#7323631) you can install an older Xcode to get the SDK and then copy it over to the new one. I have not tried it, so I don't know for sure whether it works. – user1118321 May 15 '17 at 05:35