iPhone CoreData - How to fetch managed objects, and sorting them ignoring case?

前端 未结 4 456
我寻月下人不归
我寻月下人不归 2020-12-24 12:23

Does anyone know how to fetch some results sorting them alphabetically but ignoring case?

4条回答
  •  离开以前
    2020-12-24 12:42

    Swift Version:

    let sortDescriptor = NSSortDescriptor(key: "firstName", ascending: true, selector: #selector(NSString.localizedCaseInsensitiveCompare))
    

提交回复
热议问题