ios – 为什么AppDelegate继承自UIResponder?

前端之家收集整理的这篇文章主要介绍了ios – 为什么AppDelegate继承自UIResponder?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我注意到,与创建在 Xcode 4.2测试版4的iPhone主从模板创建一个新项目时,它的作用:
// AppDelegate.h

@interface AppDelegate : UIResponder <UIApplicationDelegate>

为什么AppDelegate中从UIResponder而不是NSObject的继承?

解决方法

Converting to Storyboards Release Notes

Note: In the current Xcode templates,the application delegate class inherits from UIResponder. This is so that the delegate instance can participate in the responder chain and so handle application-level actions. If you haven’t made use of this pattern in an existing application,there’s no need to adopt it for storyboards.

原文链接:https://www.f2er.com/iOS/337401.html

猜你在找的iOS相关文章