Re: Re-using a custom view
Re: Re-using a custom view
- Subject: Re: Re-using a custom view
- From: Sanford Selznick <email@hidden>
- Date: Fri, 8 Dec 2006 12:23:09 -0700
At 10:54 AM -0800 12/8/06, Shawn Erickson wrote:
What's the easiest way? The solutions I'm finding out there are
kind of complicated. I'm looking for something nice and simple.
:-)
1) Put that view into a nib.
2) Define a "controller" class and make that class the owner of the nib.
3) Add an outlet from the "controller" class (files owner) to the
view in the nib.
4) Have the "controller" class use NSNib to instantiate new
instances of the nib (make sure to correctly manage top-level
objects of the nib).
5) Each time you need the view instantiate a new "controller" class
and do what you want with the view it has a reference to.
Wonderful. Thank you very much.
Is 5 as simple as calling NSView's addSubView on the "host" view?
Will that fix up field tab ordering and everything?
Thanks,
Sanford
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden