Best way to implement a listing view (crosspost from omni)
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.