• 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
Bindings and sorted data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Tiger for ASD?
  • Next by Date: Re: Tiger for ASD?
  • Previous by thread: Re: -alloc -init of an Object Instance Variable? Resolved
  • Next by thread: Using .nib files for non IB objects
  • Index(es):
    • Date
    • Thread