开发者

Cocoa: Actions Processing

the book which I study, to transition from C++ to Objective-C, places all the Action Methods into Application Delegate class.

The sample code within the book works. However, I am thinking, what if I have 100, or in extreme cases 500, controls in my application. Will all the controlls' actions be processed in the same Application Delegate class? This look to me as very messy.

Could you, therefore, help me to answer my question, please:

If I have many controls (buttons, processing bars, fi开发者_如何转开发elds ... ) in my application, is Application Delegate the only and correct place for processing all the action methods?


No.

Books use the Application delegate because it is a convenient place to put example code.

As you write your own programs, you'll have your own hierarchy of controllers to receive action messages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜