FROM : Erik Buck
DATE : Fri Jun 02 20:34:53 2006
A cell prototype is copied as needed to create more cells for display in the matrix. Any copies replicate all of the state configured for the prototype cell such as text alignment, button mode, etc.
The cell class specifies the class used to create new cell instances from scratch as needed for display in the matrix. Newly created instances typically have default state values such as left aligned text and momentary push for buttons etc.
If you care about the initial state of cells, set a prototype to be copied. If not, just set the cell class.
If this distinction is not clear in Apple’s documents, you should file a bug report against the documents.
See also the “Prototype” design pattern. (Why isn’t this pattern mentioned in Apple’s documentation about design patterns used in Cocoa ?)
See http://www.mindspring.com/~mgrand/pattern_synopses.htm#Prototype
The “Factory Method” pattern is not needed with Objective-C because class objects are regular objects that can be stored in a variable. The goal of the “Factory Method” pattern is met by just setting the cell class for the matrix to use. Some other languages treat “class” as a compile-time only construct and there is no way to store a “class” in a variable in such languages.
DATE : Fri Jun 02 20:34:53 2006
A cell prototype is copied as needed to create more cells for display in the matrix. Any copies replicate all of the state configured for the prototype cell such as text alignment, button mode, etc.
The cell class specifies the class used to create new cell instances from scratch as needed for display in the matrix. Newly created instances typically have default state values such as left aligned text and momentary push for buttons etc.
If you care about the initial state of cells, set a prototype to be copied. If not, just set the cell class.
If this distinction is not clear in Apple’s documents, you should file a bug report against the documents.
See also the “Prototype” design pattern. (Why isn’t this pattern mentioned in Apple’s documentation about design patterns used in Cocoa ?)
See http://www.mindspring.com/~mgrand/pattern_synopses.htm#Prototype
The “Factory Method” pattern is not needed with Objective-C because class objects are regular objects that can be stored in a variable. The goal of the “Factory Method” pattern is met by just setting the cell class for the matrix to use. Some other languages treat “class” as a compile-time only construct and there is no way to store a “class” in a variable in such languages.
| Related mails | Author | Date |
|---|---|---|
| Graham | Jun 2, 19:23 | |
| Erik Buck | Jun 2, 20:34 |






Cocoa mail archive

