此代碼在Xcode 8 beta 5上編譯,但在beta 6中損壞。什麼是正確的新Swift 3方式來做這種比較?Xcode 8 beta 6 swift 3 localizedCaseInsensitiveCompare
self.categories = categories.sorted { $0.localizedCaseInsensitiveCompare($1) == ComparisonResult.orderedDescending }
的錯誤是
Argument passes to call that takes no arguments
如果錯誤信息真的很糟糕,可能要在bugs.swift.org上提交一個錯誤。它指出它在說什麼? – jtbandes
該代碼適用於我,但文檔建議使用排序(按:<)來降序排序。 – jjatie
你可以在Swift 3中使用'sort'而不用'ed'來排序。 'categories.sort {$ 0.localizedCaseInsensitiveCompare($ 1)== .orderedDescending}' –