NSDiacriticInsensitivePredicateOption not supported by Realm

后端 未结 1 697
北恋
北恋 2021-01-20 14:39

I have DictObject with a text property that contains some Vietnamese letters, such as \"Sống\".

@interface DictObj : RLMObject
@property NSStrin         


        
相关标签:
1条回答
  • 2021-01-20 15:10

    Realm Objective-C v2.5.0 added support for the diacritic-insensitive modifier on most string operations. All supported string comparison operators except LIKE now support the [d] modifier.

    Note that there is a performance tradeoff in performing a diacritic-insensitive comparison. If you're doing very frequent lookups it may be preferable to pre-compute a version of the string with the diacritics stripped and store it in a second property on your model. You could then use the diacritic-free property in queries, while continuing to use the original property for display purposes. If you have existing data stored in your Realm, you can add the extra property to your class and populate it for existing objects within a migration.

    0 讨论(0)
提交回复
热议问题