• 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: Artemiy Pavlov <email@hidden>
  • Date: Mon, 20 Dec 2010 16:42:47 +0200

I think I know what's the problem, it's this line.

[self addSubview:PatternRateLabel];

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.


All the best,

Artemiy.

On 20 Dec 2010, at 16:25, Artemiy Pavlov wrote:

I have run Instruments and I see a ton of these calls:

-[NSWindow fieldEditor:forObject:]

So I indeed see that there's something I am not doing right with the NSTextField.

On 20 Dec 2010, at 16:09, Mike Abdullah wrote:

Use Instruments to find out where the slowness lies. Come back once you'e got more information and still don't know the cause.

On 20 Dec 2010, at 13:31, Artemiy Pavlov wrote:

Hi all!

I have a Cocoa view that reacts to -mouseDown and -mouseDragged events and then draws something via -drawRect method.

It has about 50 objects that are either NSBezierCurve or NSTextField. The problem is, after a few seconds of mouse dragging, the view becomes very sluggish. I release all of the NSTextField and NSString objects immediately after drawing them.

What could be causing this slow-down? I'd appreciate any advise.


Thanks and best wishes,

Artemiy.
_______________________________________________

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


_______________________________________________

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

_______________________________________________

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


  • Follow-Ups:
    • Re: Cocoa view gets sluggish over time
      • From: Graham Cox <email@hidden>
    • Re: Cocoa view gets sluggish over time (solved!)
      • From: Artemiy Pavlov <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>)

  • Prev by Date: Re: NSTextField: text appears aliased
  • Next by Date: Re: NSTextField: text appears aliased
  • Previous by thread: Re: Cocoa view gets sluggish over time
  • Next by thread: Re: Cocoa view gets sluggish over time (solved!)
  • Index(es):
    • Date
    • Thread