Re: Making views disappear and reappear
Re: Making views disappear and reappear
- Subject: Re: Making views disappear and reappear
- From: Mark T <email@hidden>
- Date: Sun, 24 Jun 2001 00:48:11 -0400
Here's your problem. After you remove your scroller from the view it no
longer has a superview. So this returns nil. You need to get the
window's content view. Try this in place of the above:
NSView *theSuperview = [[sender window] contentView];
One trick that works well is to place any controls/views, which you wish
to remove, inside borderless/titleless boxes and swap in and out the
content view of the box.
This works perfectly, thank you. I'm ashamed that I failed to realize
this mistake myself. But why was there no error reported at runtime
for getting the superview of a view that's not in a view?
Mark T.