Slow scrolling after NSPopup implementation
Slow scrolling after NSPopup implementation
- Subject: Slow scrolling after NSPopup implementation
- From: Steven Hamilton <email@hidden>
- Date: Fri, 15 May 2009 19:56:12 +1000
Hi folks,
I hope I can explain this clearly enough. Here goes... ;)
I have an NSTableview in my Core Data app. I have a custom controller
providing the tableViews datasource and delegate methods as I need to
mung the data a bit between the MOC and the View. This all works fine.
In one column I've replaced an NSTextView, where a user would type
data, with an NSPopup to make it easier for them. To make this work I
have created an NSArrayController set to the "Account" entity in the
MOC and bound the column to the NSArrayController for Content and
Content Values. All good still.
In my custom controller I have an array of dictionaries that contain
the table data and it's this array that the datasource method uses to
provide table data. One of the key's of the array is to provide the
index of the Account that should be displayed in the NSPopup.
My datasource method looks like this;
- (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;
} else {
return ([[self.formattedTransactions objectAtIndex:row] objectForKey:
[tableColumn identifier]]);
}
}
My NSPopup column binding "Selected Index" is bound to the
"self.selectedTransferIndex" property of my custom controller above.
When the tableview delegate is called, It pulls the correct index from
the array and sets that property. The binding on the tableColumn then
updates the NSPopup. This works great functionally but creates
intolerable drag when scrolling which makes me think I'm going about
this the wrong way.
Is this the correct method of using an NSPopupCell in the
NSTableColumn? Even doing self.selectedTransferIndex = [NSNumber
numberWithInt:0] produces a slow result which means it's either the
assignment itself, or the binding in the nib object thats slowing
things down.
Any help gratefully received.
_______________________________________________
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