0
我試圖將一些參數傳遞給我的解析雲代碼函數,並在Xcode中收到以下錯誤消息。 cannot convert value of type '[String : String?]' to type '[NSObject : AnyObject]' in coercion
。它工作正常,直到我參考incomingUser.objectId
。以下是我所傳遞的代碼:鍵入objectId來解析雲代碼
let params = ["userType" : userType, "recipient" : self.incomingUser.objectId]
PFCloud.callFunctionInBackground("pushNotification", withParameters: params as [NSObject : AnyObject]) {
(res: AnyObject?, error: NSError?) -> Void in
print(res)
print(error)
}
感謝您提供任何幫助。
警衛工作聲明此。你介意解釋爲什麼需要「展開」?非常感謝你的幫助! – Robert
我會推薦[this](http://stackoverflow.com/questions/24034483/what-is-an-unwrapped-value-in-swift)供參考。我不擅長用英語解釋事情:P。但是,在閱讀完上述答案之後,請告訴我您是否有其他難題。 –
會做,再次感謝! – Robert