Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:48:45+00:00 2026-06-09T04:48:45+00:00

I am sorting results of a fetch request with a sort descriptor. NSFetchRequest* req

  • 0

I am sorting results of a fetch request with a sort descriptor.

NSFetchRequest* req = [[NSFetchRequest alloc] initWithEntityName:[MyEntity entityName]];
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"property" 
                                                           ascending:YES 
                                                            selector:@selector(localizedCompare:)];
req.sortDescriptors = [NSArray arrayWithObject:descriptor];
return [self.managedObjectContext executeFetchRequest:req error:nil];

The problem is the words, which begins with non-english chars like ‘İ’ are listed at the end of the list. It is a turkish letter and the alphabet looks like this :

A, B, C, Ç, D, E, F, G, Ğ, H, I, İ, J, K, L, M, N, O, Ö, P, R, S, Ş, T, U, Ü, V, Y, Z.

So the letter is at 12th position.

I don’t know why but using comparator after fetching objects works. So it works on any array but not with sort descriptor for fetch request.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:48:46+00:00Added an answer on June 9, 2026 at 4:48 am

    Take a look at the details of my question at NSFetchedResultsController v.s. UILocalizedIndexedCollation I show how to use the UILocalizedIndexedCollation to correctly generate the Alphabet and sort using the correct sort method based on the UILocalizedIndexCollation. My question just revolves around asking for a better way to do this.

    If you dont use the UILocalizedIndexCollation you should only use the localizedStandardCompare: not localizedCompare as mentioned in the WWDC videos for localization.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problem with sorting my query results by the count field. My simplified
In DataTable I could sorting with dataTable.DefaultView.Sort = SortField DESC; I'm getting a DataSet
I using jquery sorting ( http://jqueryui.com/demos/sortable/ ). Is it possible to sort (move list)
I'm sorting numerically on a specific column of a ; separated file with: sort
I've a problem sorting an nsarray. The nsarray is filled with core data: NSFetchRequest
I am using JS sorting to call this method: def sort params[:piece].each_with_index do |id,
I want to sort my lucene(.net) search results by a date field (date1), but
I'm having issues sorting in Perl having different results in Windows and Unix. The
just wondering if theres a way of sorting the results of a query ignoring
I am having a problem sorting results from joining tables that have to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.