views:

33

answers:

1

Hi,

How can I set my fetchedResultsController.sortDescriptors to contain a sortdescriptor that uses a keypath, for instance, such as @"foo.name"?

Cheers

Nik

+2  A: 

Despite NSSortDescriptor's use of the name “key”, it actually takes a key path, as described in the documentation. So, just create an NSSortDescriptor with your key path as the “key”, and use that.

Peter Hosey
Ah, thanks a lot. I tried that, but it failed, but the document sais so indeed so I must have got something else wrong. Thanks for the help :-)
niklassaers