Re: Qustion about possibly bad advice in NSView documentation
Re: Qustion about possibly bad advice in NSView documentation
- Subject: Re: Qustion about possibly bad advice in NSView documentation
- From: Erik Buck <email@hidden>
- Date: Tue, 25 Sep 2007 08:40:44 -0700 (PDT)
The following is absolutely feasible; it's just not what the documentation seems to be suggesting:
- (void)setNeedsDisplayInRectWrappedInValue:(NSValue *)aValue
{
[self setNeedsDisplayInRect:[aValue rectValue]];
}
- (void)drawRect:(NSREct)aRect
{
[self performSelector:@selector(setNeedsDisplayInRectWrappedInValue:) withObject:[NSValue valueWithRect:NSMakeRect(0,0,100,100)] afterDelay:0.0];
}
I think the documentation is giving bad advice, and the easiest and best solution is to NOT try and invalidate rects from within -drawRect: at all thus avoiding the entire issue.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden