Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我了解可选与必需委托方法的优缺点。但令我震惊的是,需要的 iOS 委托方法如此之少。iOS SDK 设计者是否有一些我没有的智慧?有什么他们试图避免但我看不到的东西吗?
提前致谢。
最简单的答案是大多数程序不会使用大多数委托方法,因此与其让开发人员创建不使用的空方法,不如将这些方法指定为可选的,并且仅在需要时才可以使用。之所以有这么多方法,是因为 SDK 设计者提供了很多你可以做的事情,这对于像智能手机这样强大的设备来说是必要的。