有任何想法吗?
代码是:
func testFileStatusNotifications() {
let x : XCNotificationExpectationHandler = { (n : NSNotification!) -> Bool in
// Extract userInfo
let u = n.userInfo!
let dict = u.values.first as! [String : Double]
let percent = dict["percent"]!
return (percent > 10)
}
看来处理程序类型必须已更改:
typealias XCNotificationExpectationHandler = (NSNotification) -> ObjCBool
因为它现在是类型ObjCBool