Re: removeFromSuperview crash - please help
Re: removeFromSuperview crash - please help
- Subject: Re: removeFromSuperview crash - please help
- From: Jacob Lukas <email@hidden>
- Date: Sat, 6 Nov 2004 12:33:52 -0800
- (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 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