函数产生预期类型'(() - >())?';你的意思是用'()'来称呼它吗?
我收到了上述错误。 Xcode的自动修复无济于事。
错误发生在self.performOnCommunicationQueue()
:
func getAuthParams(authClosure:((error:NSError?) -> ())?) {
logDebug("Starting sync session with Max device")
if let statusError = self.assertReady() {
logError("Start sync session failed with error: \(statusError)")
if (authClosure != nil) {
authClosure!(error: statusError)
}
} else {
self.performOnCommunicationQueue() {
let error:NSError?
// Set random starting byte
let oAbsTime:[UInt64] = [mach_absolute_time()]
let payload:NSData = NSData(bytes: oAbsTime, length: 8)
let absTime:UInt8 = UnsafePointer<UInt8>(payload.bytes).memory
self.randomCryptoByte = (0x01 | ( absTime & 0xfe))
}
}
func sendAuthChallenge(authChal:String, completion:((error:NSError?) -> ())?) {
}
func performOnCommunicationQueue(closure:(()->())?){
if (closure != nil)
{
self.communicationQueue?.addOperationWithBlock(closure!)
}
}
答案 0 :(得分:4)
我认为这就是你想要的:
$(".weekHourValue[data-month='5'][data-day='10'] {where not exist in element}").append("<div class='singleYearEvent'></div>");
这会创建self.performOnCommunicationQueue({ () -> () in
let error:NSError?
// Set random starting byte
let oAbsTime:[UInt64] = [mach_absolute_time()]
let payload:NSData = NSData(bytes: oAbsTime, length: 8)
let absTime:UInt8 = UnsafePointer<UInt8>(payload.bytes).memory
self.randomCryptoByte = (0x01 | ( absTime & 0xfe))
})
所需的无效闭包空洞。
另外,一旦你做了这个改变,检查你的大括号是否匹配,我认为你可能只是一个简短,这就是为什么自动完成不是一个帮助。