I have an app for iOS that uses Core Data to save and retrieve data.
How would I fetch data sorted by a field of NSString type in natural sort order?
Right now the result is:
100_title
10_title
1_title
I need:
1_title
10_title
100_title
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use localizedStandardCompare: as selector in the sort descriptor for the Core Data fetch request, for example
Swift 3:
or better
where “Entity” is the name of the Core Data managed object subclass.