• 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
Best way to implement a listing view (crosspost from omni)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best way to implement a listing view (crosspost from omni)


  • Subject: Best way to implement a listing view (crosspost from omni)
  • From: "Mike R. Manzano" <email@hidden>
  • Date: Thu, 1 Apr 2004 11:29:55 -0800

Hi Guys,

I am implementing a listing viewit is similar to a table view, but allows only one column, but where each row is capable of displaying a different type of NSCell (of variable height, and of variable look and feel).

Here's my question: how would you make this most efficient?

(1) I could go ahead and ask my datasource to supply a cell for every row in the listing view, and use that cell to draw and provide input handling.
(2) I could instantiate only one instance of each type of NSCell to be drawn, and when I'm rendering, use the instances that I have to draw the rows whose values are fetched from the data source (perhaps using NSDictionaries, or perhaps NSCoding, as each cell would need to be configured in their own manner). This would be kind of like the Flyweight design pattern I suppose.

I don't know enough about Cocoa to see what kind of overhead is involved in serialization (NSCoding), creating NSDictionaries, or instantiating NSCells to be able to make an informed decision on implementation.

Any wise people out there willing to put in $0.02?

Regards,

Mike R. Manzano
alephx01 (at) mac (dot) com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Sending an AppleScript Studio Object a message from Obj-C
  • Next by Date: RE: Obtaining printer info
  • Previous by thread: Sending an AppleScript Studio Object a message from Obj-C
  • Next by thread: Re: returning nil on initialization
  • Index(es):
    • Date
    • Thread