有什么想法吗?
代码是:
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
答案 0 :(得分:0)
func testFileStatusNotifications() {
let x : XCNotificationExpectationHandler = { (n : NSNotification!) -> ObjCBool in
// Extract userInfo
let u = n.userInfo!
let dict = u.values.first as! [String : Double]
let percent = dict["percent"]!
let ret = (percent > 10)
return ObjCBool(ret)
}
这似乎已经解决了问题。