ios - Case Insensitive Compare with Core Data and Swift -
the following code doesn't work:
let sortdescriptor = nssortdescriptor(key: "name", ascending: true, selector:"caseinsensitivecompare")
and gives following error: 'nsinvalidargumentexception', reason: 'unsupported nssortdescriptor selector: caseinsensitivecompare'
seemed work fine in objective-c. ideas on why might be?
edit: seems may not possible core data/sqlite. in case, best option array , sort in code afterwards?
the selector caseinsensitivecompare:
, colon, , can use core data.
the colon there because method (which instance method of nsstring
) takes 1 argument (the string compare with).
as list of sort selectors can used core data , sqlite store can found in persistent store types , behaviors in core data programming guide.
Comments
Post a Comment