Helper Objects (Chapter 6 of Cocoa Programming for Mac OS X)
Many objects in the Cocoa framework areextended in much the same way. That is, there is an existing object that needsto be extended for your purpose. Instead of subclassing the table view, yousimply supply it with a helper object. For example, when a table view is aboutto display itself, it will turn to the helper object to ask "How many rows ofdata am I displaying?" "What should be displayed in the first column, secondrow?"Thus, to extend an existing Cocoaclass, you will frequently write a helper object. This chapter focuses oncreating helper objects and connecting them to the standard Cocoa objects.
页:
[1]