The following code does not work:
let sortDescriptor = NSSortDescriptor(key: "name", ascending: true, selector:"caseInsensitiveCompare")
And gives the following error: "NSInvalidArgumentException", reason: "unsupported selector NSSortDescriptor: caseInsensitiveCompare"
It seemed to work fine in Objective-C. Any ideas on why this might be?
Edit: Looks like it might not be possible with Core Data / SQLite. In this case, it is best to get an array and sort it in code after?
source
share