Skip navigation.
 
mlRe: removeFromSuperview crash - please help
FROM : Jacob Lukas
DATE : Sat Nov 06 21:33:52 2004

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

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