• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSMatrix setCellClass: vs setPrototype:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMatrix setCellClass: vs setPrototype:


  • Subject: Re: NSMatrix setCellClass: vs setPrototype:
  • From: Erik Buck <email@hidden>
  • Date: Fri, 2 Jun 2006 11:34:53 -0700 (PDT)

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.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Newbie error
  • Next by Date: Re: Problem with subview creation or it in somewhere else
  • Previous by thread: NSMatrix setCellClass: vs setPrototype:
  • Next by thread: Double-click/Return/Enter in NSTableView
  • Index(es):
    • Date
    • Thread