NSPredicate omits special characters like á â á in filterContentForSearchText method

前端 未结 1 1628
孤城傲影
孤城傲影 2021-01-24 16:46

I am developing an app with an UISearchBar and I need to filter some names with special characters like à, è, ê and so on.. but if I don\'t typ

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-24 17:11

    Ignore diacrtical needs to be specified, "[cd]" instead of "[c]".

    See NSHipster: NSPredicate.

    NSComparisonPredicate Options:
    NSDiacriticInsensitivePredicateOption: A diacritic-insensitive predicate. You represent this option in a predicate format string using a [d] following a string operation (for example, "naïve" like[d] "naive").

    Such a common error, it kept me from finding my Metro Station in Paris.

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