Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何方法或方法可以使用敏感比较器对字符串数组进行排序?
我的意思是,如果我有以下数组:
abbie Ann alice Boris Bob billy
我需要收到:
Ann abbie alice Bob Boris billy
myArray = [myArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
从文档中:
返回一个 NSComparisonResult 值,该值指示接收者的词法顺序和使用不区分大小写的本地化比较的给定字符串。
和Apple 文档页面。