FROM : Matt Neuburg
DATE : Mon Jan 14 20:28:54 2002
On Fri, 11 Jan 2002 10:39:53 -0500, Robert Miller
<<email_removed>> said:
> This is probably a basic question but I've had no l uck solving the
>problem. I have a custom view instantiated in my nib file. The view
>contains other subviews such as buttons, etc. I want to be able to load
>this custom view programatically and then install it as a subview of
>some other view
What I do is to group the custom view instance into a box and make an
outlet to the box. Thus, my view is the box's contentView. I can now
replace some other object's contentView with it. So for example (this is
pretty much just lifted right out of the Learning Cocoa book):
aView = [[myBox contentView] retain];
[aView removeFromSuperview];
[ourWindow setContentView: aView]; // or whatever
[aView release];
m.
--
matt neuburg, phd = <email_removed>, http://www.tidbits.com/matt
pantes gar anthropoi tou eidenai oregontai phusei
DATE : Mon Jan 14 20:28:54 2002
On Fri, 11 Jan 2002 10:39:53 -0500, Robert Miller
<<email_removed>> said:
> This is probably a basic question but I've had no l uck solving the
>problem. I have a custom view instantiated in my nib file. The view
>contains other subviews such as buttons, etc. I want to be able to load
>this custom view programatically and then install it as a subview of
>some other view
What I do is to group the custom view instance into a box and make an
outlet to the box. Thus, my view is the box's contentView. I can now
replace some other object's contentView with it. So for example (this is
pretty much just lifted right out of the Learning Cocoa book):
aView = [[myBox contentView] retain];
[aView removeFromSuperview];
[ourWindow setContentView: aView]; // or whatever
[aView release];
m.
--
matt neuburg, phd = <email_removed>, http://www.tidbits.com/matt
pantes gar anthropoi tou eidenai oregontai phusei
| Related mails | Author | Date |
|---|---|---|
| Robert Miller | Jan 11, 16:39 | |
| Stéphane Sudre | Jan 11, 17:38 | |
| Markus Hitter | Jan 12, 13:20 | |
| Matt Neuburg | Jan 14, 20:28 | |
| Henri Lamiraux | Jan 14, 21:32 | |
| Ondra Cada | Jan 15, 00:08 |






Cocoa mail archive

