Re: removeFromSuperview crash - please help
Re: removeFromSuperview crash - please help
- Subject: Re: removeFromSuperview crash - please help
- From: Keith Blount <email@hidden>
- Date: Sat, 6 Nov 2004 12:48:28 -0800 (PST)
Many thanks for the reply. This does make sense, but
unfortunately, on trying it, it didn't help - I had
exactly the same crash as I did when just releasing
the views - if I remember correctly something I read
here, I think this might be because
removeFromSuperview takes a couple of cycles to
complete, so I guess autorelease might release the
view before removeFromSuperview completes. Not sure if
that is right, though.
I would really appreciate any other suggestions, as
this has me stumped.
Thanks again,
Keith
--- Jacob Lukas <email@hidden> wrote:
> > - (BOOL)resignFirstResponder
> > {
> > if ([[self string] length] == 0)
> > {
> > // If there is nothing in the text view, delete
> the
> > notecard:
> >
> > [[self superview] removeFromSuperview];
> How about:
> [[[[self superview] retain] autorelease]
> removeFromSuperview];
> > return YES;
> > }
> > return [super resignFirstResponder];
> > }
>
> > // Remove all the cards from the view
> > - (void)clear
> > {
> > id sv;
> > NSEnumerator *enumerator = [[self subviews]
> > objectEnumerator];
> > while (sv = [enumerator nextObject])
> > {
> > if ([sv textView] == [[sv window]
> firstResponder])
> > [[sv window] makeFirstResponder:nil];
> > [sv removeFromSuperview];
> Similarly,
> [[[sv retain] autorelease] removeFromSuperview];
> > }
> > }
>
> Jacob
>
>
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
_______________________________________________
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