Re: Cocoa view gets sluggish over time
Re: Cocoa view gets sluggish over time
- Subject: Re: Cocoa view gets sluggish over time
- From: Graham Cox <email@hidden>
- Date: Tue, 21 Dec 2010 10:45:32 +1100
On 21/12/2010, at 1:42 AM, Artemiy Pavlov wrote:
> With each -drawRect call, NSTextField objects are not being redrawn from scratch, they are added on top of the existing ones. So I end up with thousands of them.
>
> I guess I need to put this code in -awakeFromNib. And then, if needed, change the text field strings or properties in -drawRect.
You got it.
In general,you should not be creating/disposing/adding objects to your data model (or view hierarchy) in -drawRect:. That should be strictly limited to drawing what you already have.
--Graham
_______________________________________________
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