的代码如何?
@selector(caseInsensitiveCompare:)
在斯威夫特?
我尝试对字典数组进行排序
NSSortDescriptor(key: "name", ascending: true, selector: Selector(???))
由于
答案 0 :(得分:6)
Swift 3
NSSortDescriptor(key: "name", ascending: true, selector: #selector(NSString.caseInsensitiveCompare(_:)))
Swift 2
NSSortDescriptor(key: "name", ascending: true, selector: "caseInsensitiveCompare:")