Re: Random crash in -[NSView displayIfNeeded]
Re: Random crash in -[NSView displayIfNeeded]
- Subject: Re: Random crash in -[NSView displayIfNeeded]
- From: "Louis C. Sacha" <email@hidden>
- Date: Fri, 22 Oct 2004 05:24:48 -0700
Hello...
What method are you using to remove the progress bar when you hide it?
<
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSView.html#//apple_ref/doc/uid/20000014/removeFromSuperviewWithoutNeedingDisplay>
- (void)removeFromSuperviewWithoutNeedingDisplay
"Unlinks the receiver from its superview and its NSWindow, removes it
from the responder chain, but does not invalidate its cursor
rectangles to cause redrawing. The receiver is also released; if you
plan to reuse it, be sure to retain it before sending this message
and to release it as appropriate when adding it as a subview of
another NSView.
Unlike its counterpart, removeFromSuperview, this method can be
safely invoked during display."
Hope that helps,
Louis
More information about this. My code hides & shows a progress bar in
the main window by adding or removing it to/from a view in the
window. Since it can happen that insertion/removal happen several
times a second, I suspect that at some point Cocoa gets 'lost' in
thinking that an object that has been removed is still there. But
that's still strange since my progress bar is retained by my code,
so the object ptr is still valid.
Anyway, I'll try using a slower timer to hide/show the progress bar
and see how that goes. I'm still taking hints at what could be the
actual cause of the crash ;-)
Florent
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden