Skip navigation.
 
mlRe: removeFromSuperview crash - please help
FROM : Keith Blount
DATE : Sat Nov 06 21:48:28 2004

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_removed>> 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

Related mailsAuthorDate
mlremoveFromSuperview crash - please help Keith Blount Nov 6, 19:46
mlRe: removeFromSuperview crash - please help Jacob Lukas Nov 6, 21:33
mlRe: removeFromSuperview crash - please help Keith Blount Nov 6, 21:48
mlRe: removeFromSuperview crash - please help Matt Neuburg Nov 6, 21:49
mlRe: removeFromSuperview crash - please help (solved) Keith Blount Nov 7, 00:40