• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa view gets sluggish over time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Cocoa view gets sluggish over time (From: Artemiy Pavlov <email@hidden>)
 >Re: Cocoa view gets sluggish over time (From: Mike Abdullah <email@hidden>)
 >Re: Cocoa view gets sluggish over time (From: Artemiy Pavlov <email@hidden>)
 >Re: Cocoa view gets sluggish over time (From: Artemiy Pavlov <email@hidden>)

  • Prev by Date: Re: access multiple NSTextFields as an array?
  • Next by Date: Re: Core Data mergeChangesFromContextDidSaveNotification: does not *completely* update the context ?
  • Previous by thread: Re: Cocoa view gets sluggish over time (solved!)
  • Next by thread: NSTextField: text appears aliased
  • Index(es):
    • Date
    • Thread