• 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: Building a panel with templated views?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building a panel with templated views?


  • Subject: Re: Building a panel with templated views?
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Sun, 31 Oct 2004 00:19:46 +0200

At 9:24 Uhr +1000 28.10.2004, Graham cox wrote:
So I created each line of items as children of a custom view in IB. The question I have is how to take those and make instances as needed at run time. I can easily get one instance of each type, but it's unclear how to make clones - I need the custom view object from IB to act as a template for numerous future instances rather than an actual instance.

Basically, you have two choices:

1) copy your object using -copy (not sure that works for views and their subviews, though, if you subclass you may have to implement copyWithZone:)

2) put each custom view in its own NIB file. Then you can use the NSBundle NIB loading methods to load a new copy of your views each time.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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
References: 
 >Building a panel with templated views? (From: Graham cox <email@hidden>)

  • Prev by Date: Re: vDSP, anyone using it?
  • Next by Date: Re: +[NSBundle bundleWithPath:] avoiding the cache?
  • Previous by thread: Re: Building a panel with templated views?
  • Next by thread: Updating /etc/hostconfig
  • Index(es):
    • Date
    • Thread