• 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
NSMutableArray compare:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMutableArray compare:


  • Subject: NSMutableArray compare:
  • From: Yorh <email@hidden>
  • Date: Tue, 4 Jul 2006 12:09:23 +0200

Hi to all,

I have an NSTableView and an NSMutableArray to compare in order to sort the NSTableColumns.
I added this code in the tableView data source:


- (void)tableView:(NSTableView *)tableView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn{

if ([[tableColumn identifier] isEqual:@"name"]){
[[[[GAChannelList sharedInstance] allData] valueForKey:@"channelName"] sortUsingSelector:@selector(compare:)];
}
else if ([[tableColumn identifier] isEqual:@"users"]){
[[[[GAChannelList sharedInstance] allData]valueForKey:@"users"] sortUsingSelector:@selector(compare:)];
}
[channelListView reloadData];


}

The shared instance returns a NSMutableArray, but if I click on the table header xcode returns me this error:

*** -[NSCFArray sortUsingFunction:context:]: mutating method sent to immutable object

This is strange because as I said before I have this code in the shared instance:

-(NSMutableArray*)allData
{
		return allData;

}

How can I do?
Thank you all for your kind support
Yorh

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSMutableArray compare:
      • From: Stephane Sudre <email@hidden>
  • Prev by Date: NSViewAnimation with curved path
  • Next by Date: Re: "Multiple Inheritance" between NSTableView and NSOutlineView
  • Previous by thread: NSViewAnimation with curved path
  • Next by thread: Re: NSMutableArray compare:
  • Index(es):
    • Date
    • Thread