Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building a panel with templated views?



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Building a panel with templated views? (From: Graham cox <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.