【发布时间】:2015-02-06 13:40:34
【问题描述】:
如何使用多个属性对我的 Realm 结果进行排序?
我首先使用这样的一个属性对它们进行排序:
allShows = Show.allObjects().sortedResultsUsingProperty("dateStart", ascending: true)
但现在我还想通过另一个属性“timeStart”进行二次排序。我试过这样:
allShows = Show.allObjects().sortedResultsUsingProperty("dateStart", ascending: true).sortedResultsUsingProperty("timeStart", ascending: true)
这只会使结果仅按第二个属性排序。请帮忙。
【问题讨论】: