Re: Sorting an array

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
Great! Thanks a lot. (Just for the record: it's called sortUsingSelector: ) Best regards, Gabriel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Re: Sorting an array

2020-02-11 Thread Jens Alfke via Cocoa-dev
> On Feb 11, 2020, at 4:59 AM, Gabriel Zachmann via Cocoa-dev > wrote: > > First of all, what are the advantages/disadvantages of either method? Sort descriptors are data; selectors are [references to] code. So a sort descriptor lets you configure the sorting without having to write any

Re: Sorting an array

2020-02-11 Thread Sandor Szatmari via Cocoa-dev
Gabriel, > On Feb 11, 2020, at 10:36, Gabriel Zachmann via Cocoa-dev > wrote: > > I have some trivial questions regarding sorting a simple array of strings. > > I used to use this code: > >NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey: nil > a

Sorting an array

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
I have some trivial questions regarding sorting a simple array of strings. I used to use this code: NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey: nil ascending: YES];//TODO: raus [imagefiles_ sortUsingDescriptors: @[sd] ]; where imagefiles_ is an NSMutableArray* . Now