在Xcode 6.3中获取Invoke错误

时间:2015-04-16 03:09:57

标签: xcode

func allItems() -> [TodoItem] {
    var todoDictionary = NSUserDefaults.standardUserDefaults().dictionaryForKey(ITEMS_KEY) ?? [:]
    let items = Array(todoDictionary.values)
    *return items.map({TodoItem(deadline: $0["deadline"] as NSDate, title: $0["title"] as String, UUID: $0["UUID"] as String!)}).sorted({
    return ($0.deadline.compare($1.deadline) == .OrderedAscending)
})
}

我在使用星号的行上收到此错误:

cannot invoke ‘sorted’ with an argument list of type ‘((_. _)->_)'

有没有人遇到过这个问题,或者你知道为什么会出现错误吗?

0 个答案:

没有答案