• 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
Newbie: how to use custom views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie: how to use custom views


  • Subject: Newbie: how to use custom views
  • From: email@hidden
  • Date: Sat, 10 Nov 2001 20:01:18 +0100

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 ?


  • Follow-Ups:
    • Re: Newbie: how to use custom views
      • From: Bruce Sturgen <email@hidden>
  • Prev by Date: Re: Rant & Rave
  • Next by Date: Re: New Cocoa Programmer
  • Previous by thread: Re: All these newbie questions that are answered by documentation
  • Next by thread: Re: Newbie: how to use custom views
  • Index(es):
    • Date
    • Thread