13
我該如何對NSFetchRequest和託管對象的date屬性進行排序。爲了創建一個數組,日期按順序排列?NSSortDescriptor在Swift中使用NSDate排序
這是到目前爲止我的代碼...
var request : NSFetchRequest = NSFetchRequest(entityName: "History");
request.predicate = NSPredicate(format: "counts = %@", true)
request.sortDescriptors = [???] <- What should I put here?
var results : [NSManagedObject] = context.executeFetchRequest(request, error: nil) as [NSManagedObject]
我看到那些NB,但我只是習慣於在類型附近標識符聲明。我相信我會習慣它。 – 2016-01-27 02:50:10