Bindings and sorted data
Bindings and sorted data
- Subject: Bindings and sorted data
- From: Rick Bischoff <email@hidden>
- Date: Thu, 22 Jul 2004 00:41:05 -0500
Hello,
I have a table that is continiously being updated during its lifetime.
I have it all implemented in bindings right now and is working
beautifully.
Except... When the user sorts by a column in the table view, the data
gets sorted, but as soon as I add another row, kaboom-- it goes back to
the original order.
(This is just implemented right now using bindings, an NSDictionary and
an NSMutableArray )
Is it possible to maintain the currently selected sorted order while
adding and removing data using bindings alone?
Note: The controller is adding the data-- it is not user controlled
what is added or removed; I am updating the values in the view by just
calling my controller's
setTableArray: method. Example:
-(void)dataComesIn:(NSDictionary* theData) {
[tableArray addObject:theData];
[self setTableArray:tableArray];
}
-(void)setTableArray:(NSMutableArray*)theArray {
if ( theArray != tableArray ) {
[tableArray release];
tableArray = [theArray retain];
}
}
Rick Bischoff
Blog, and home for some MacOS X apps --
http://rickjr.org
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.