• 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: Slow scrolling after NSPopup implementation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow scrolling after NSPopup implementation


  • Subject: Re: Slow scrolling after NSPopup implementation
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 15 May 2009 06:12:29 -0400

On Fri, May 15, 2009 at 5:56 AM, Steven Hamilton <email@hidden> wrote:
> - (id)tableView:(NSTableView *)tableView
> objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
> {
>        if ([[tableColumn identifier] isEqualToString:@"transfer"])
>        {
>                self.selectedTransferIndex = [[self.formattedTransactions
> objectAtIndex:row] objectForKey:@"transfer"];
>                return nil;

Why are you setting this property inside of
-tableView:objectValueForTableColumn: ?  This generates a ton of KVO
activity because this method is called very frequently.  As the docs
say, it needs to be fast.

It looks like you're relying on this method being called first for the
"transfer" column to set your property to change your
NSArrayController's contents.  Bad idea.  Not only is it slow, but
it's logically incorrect and prone to breakage.  What happens if
NSTableView decides to instead ask for the columns out-of-order?
NSTableView tries to minimize its redrawing work, so I would expect
this issue to arise at some point when only part of your table view
needs drawing.

--Kyle Sluder
_______________________________________________

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: Slow scrolling after NSPopup implementation
      • From: Steven Hamilton <email@hidden>
References: 
 >Slow scrolling after NSPopup implementation (From: Steven Hamilton <email@hidden>)

  • Prev by Date: Re: singletons and autoreleased objects (Karan, Cem (Civ, ARL/CISD))
  • Next by Date: Re: Slow scrolling after NSPopup implementation
  • Previous by thread: Slow scrolling after NSPopup implementation
  • Next by thread: Re: Slow scrolling after NSPopup implementation
  • Index(es):
    • Date
    • Thread