xcode - Swift 1.2 StringLiteralConvertable error -
i updated xcode 6.3 swift 1.2, , received on 300 errors, of involved adding exclamation point. 1 type of issue not go away, however, error "'_' not convertible 'stringliteralconvertable'". appears multiple times, in these situations:
pfcloud.callfunctioninbackground("modifyuser", withparameters: ["objectid":user.objectid, "key":"won", "value":won anyobject],block:nil) pfcloud.callfunctioninbackground("modifyuser", withparameters: ["objectid":friend.objectid, "key":"parties", "value":played], block:nil) pfcloud.callfunctioninbackground("modifyuser", withparameters: ["objectid":creator.objectid, "key":"left", "value" :left], block: { (error) in self.remainingpotatos = pfuser.currentuser()["left"] as! int })
the error appears on strings keys of dictionary, however, definition stringliteralconvertable. gives?
update
this appears case of xcode detecting error not telling one. after adding '!' after 'objectid', error switched being data type of arguments. error message is:
cannot invoke 'callfunctioninbackground' argument list of type '(string, withparameters:nsdictionary, block(_)->(_)'
which part problem? (also, changing error 'error:nserror?' gives similar result.
update
looking @ parse documentation, block signature should
^(id result, nserror *error)
i tried changing block
{ (result, error) in //code }
but still receive same error
possibly not problem, appear have key in 1 of dictionaries of "value"!
isn’t valid in 1.2 (and have compiled, not made sense, in 1.1)
import foundation let left = "blah" nsstring let dict = ["value"!:left]
results in error: '_' not convertible stringliteralconvertible