Re: Newbie: how to use custom views
Re: Newbie: how to use custom views
- Subject: Re: Newbie: how to use custom views
- From: Bruce Sturgen <email@hidden>
- Date: Mon, 12 Nov 2001 10:47:06 -0600
While reasonably new myself, and assuming I understand what you are
trying to do, it sounds like NSTableView and custom NSCell sub-classes
may be more in line with what you are looking for.
On Saturday, November 10, 2001, at 01:01 PM, email@hidden wrote:
Hi,
this is yet another newbie question, so please be patient.
I have some background on how to do things in Java and Swing and want
to implement my first Cocoa app (temp converter does not count), now I
am trying to find out how some paradigms used in Swing map to Cocoa.
The task:
Imagine a view (container) that renders it's contents based on some
kind of "model". The model is basically an ordered collection of items.
Depending on the type of each item a specialized view is created and
added to the container view.
(In Swing you could implement this using a JList and a custom
ListCellRenderer.)
The problem:
I started to design the various item views in Interface Builder by
subclassing NSView. Next I wanted to visually compose the custom view
classes, but I found no way to do this without instantiating them. So I
created "prototype" instances for each view class and customized them
by adding images, text labels etc.
Now I am stuck. When rendering the model I need to create views based
on these prototype instances that were composed in IB (and stored in
the NIB file I suppose). How do I achieve this ?
Maybe I got it all wrong ?
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_________________________________
Bruce E. Sturgen
Think Different!
ICQ: 120302101 AIM: bsturg3n
Paved Roads - another form of useless government spending
I'm a Jeeps-R-Us Kid ;)