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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to