Re: Inefficient drawing - NSTableView + NSArrayController
Re: Inefficient drawing - NSTableView + NSArrayController
- Subject: Re: Inefficient drawing - NSTableView + NSArrayController
- From: Steve Weller <email@hidden>
- Date: Mon, 23 Apr 2007 20:35:15 -0700
I had this problem too.
The solution was to add one of the mutable accessors. That tells the
array controller that the whole array is not invalid when one part
changes (as would be the case with an immutable array).
I implemented:
-(unsigned)countOfImageTableData;
and
-(NSDictionary*)objectInImageTableDataAtIndex:(unsigned)index;
and ran into the problem. Only when I added:
-(void)replaceObjectInImageTableDataAtIndex:(unsigned)index
withObject:(id)obj;
did the bindings work as expected. I didn't actually have to
implement any code in the method: just its presence caused the array
controller to do the right thing.
On Apr 23, 2007, at 2:24 PM, Guy Meyer wrote:
I have got an NSTableView bound to an NSArrayController bound to an
object (nib owner) variable of to-many relationships
(NSMutableArray) KVC complaint.
Each object in the array contains a variable for each table column
(using key path).
Everything works as expected.
The issue is that any change to the array (i.e. insertion of object
or replacement of an object) forces a redraw of the whole table
(verified via Quertz Debug) even if not necessary instead of just
redrawing a single row. How can I make the table redraw a single
row (using KVC/KVO ).
In addition, currently when there is a need to update a single cell
in the table I am replacing the object in the array using
(replaceObjectIn<Key>AtIndex:withObject:) forcing a whole row
notification (which forces a whole redraw of array as described
above). How can I make the table redraw a single cell (using KVC/
KVO ).
Thanks
Guy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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
--
Bagelturf Blog http://homepage.mac.com/bagelturf/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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