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: Sat, 23 Jun 2001 18:23:52 -0400
When the docs say, "Never invoke this method during display.", I think
the meaning is that you should not call this from a -drawRect: routine
or when doing direct drawing to a view (in between -lockFocus and
-unlockFocus). I'm prepared to be enlightened on this if I am mistaken.
I believe the following should work:
NSView *itsSuperview = [[self myTable]superview];
NSRect rectToRedraw = [[self myTable]frame];
// ...
[[self myTable] retain];
[[self myTable]removeFromSuperview];
[itsSuperview setNeedsDisplayInRect: rectToRedraw];
Yes, this did work, thank you. The bigger problem, though, was that
the remove... message needs to be sent to the ScrollView, not the
TableView. When I used your code on the ScrollView, it works fine.
The new problem is getting it to reappear. [itsSuperview addSubview:
myScrollview] doesn't seem to do anything, evidenced by the app
crashing (signal 11 - SIGBUS) when i subsequently attempt to remove
the view. Is this what i should be doing?
Mark T.