NSMutableArray compare:
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