根据以下开发者网站帖子:
https://developer.apple.com/reference/foundation/nsurlconnectiondelegate?language=objc
NSURLConnectionDelegate
的以下方法已从 iOS 8 中弃用:
connection:didReceiveAuthenticationChallenge:
connection:canAuthenticateAgainstProtectionSpace:
但我仍在 iOS 9 和 iOS 10 中使用它们,操作系统也调用它们。如果它们被弃用,有人知道它们是如何工作的吗?
最佳答案
弃用意味着他们计划将其删除。因此,这并不是删除某个 API,而是宣布该 API 将来会被删除,但仍然可用。 根据经验,您可以预期在弃用后的 2 个主要版本中,API 将被删除。
维基百科是这样解释的:
In several fields, deprecation is the discouragement of use of some feature, design or practice; typically because it has been superseded or is no longer considered safe – but without completely removing it or prohibiting its use. https://en.wikipedia.org/wiki/Deprecation
我个人的偏好是始终立即修复此类警告,并在可能的情况下跟上最新、最好的 API。
关于ios - NSURLConnection 委托(delegate)适用于 iOS 9 和 10?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41810204/