Core Data and localized sort on iOS
Core Data and localized sort on iOS
- Subject: Core Data and localized sort on iOS
- From: Matt Neuburg <email@hidden>
- Date: Thu, 03 Jan 2013 12:08:32 -0800
What I do in my Core Data-based Latin and Greek vocabulary list iOS apps is maintain extra fields (attributes) that contain transliterations of the Greek/Latin terms into the English alphabet in such a way that sorting normally on those fields gives me the order that is correct for Greek/Latin. m.
On Jan 3, 2013, at 12:00 PM, email@hidden wrote:
> Message: 1
> Date: Thu, 03 Jan 2013 10:49:15 -0600
> From: Fritz Anderson <email@hidden>
> To: Cocoa-Dev Cocoa-Dev <email@hidden>
> Subject: Core Data and localized sort on iOS
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=windows-1252
>
> iOS 6
>
> I have (or will have) a Core Data store, one entity of which has an attribute that is a French word. French collates differently than English or a naïve Unicode sort would. My application will have both English and French localizations. It is next-to-nonnegotiable that the word lists I present be sorted in French order, regardless of the current locale. There will be 74,000 instances; I'd like to have tables that narrow down by incremental prefix searches.
>
> NSString has comparison methods that can take account of a specified locale, so if I'm working in code, I don't (I hope) have a problem.
>
> But I'd like to get ordered results from Core Data fetches. My first impression is that I could use the …comparator: versions of NSSortDescriptor, and put my localized comparison in the block. But I know Core Data is often pickier about what NSFetchRequest will do for you. The examples in the documentation are confined to …Key:ascending: descriptors.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden