1
votes

I'm have a NSArrayController (A) bind it to another NSArrayController (B) and I'm trying to sort the NSArrayController (B) but is not working.

Here is my code:

    NSSortDescriptor *bSortDescriptor = [[NSSortDescriptor alloc]
                                           initWithKey:@"name" ascending:YES];
    self.arrayControllerB.sortDescriptors = @[bSortDescriptor];

Does any of you knows why the NSSortDescriptor is not working?

I'll really appreciate your help.

1
How are your array controllers bound? - geowar

1 Answers

1
votes

After you change the sort descriptors, you need to invoke rearrangeObjects on the array controller. And then schedule whatever code you want to manipulate the sorted contents with dispatch_async.

Based on my answer here. Hope this helps.