我是相當新的雨燕和分析,但這裏是我的問題: 我下載了一個簡單的斯威夫特/解析的應用程序,它改編和它工作得很好,直到我決定更新現有的Parse SDK。 我得到錯誤的錯誤,我不能得到它的工作。斯威夫特 - 更新解析SDK 1.7.4後 - 錯誤信息
我不能夠分配什麼了currentuser:
即:
currentuser["location"] = PFGeoPoint(location: location)
currentuser["interestedCategory"] = self.pickerChoice
currentuser["locationLimit"] = Int(locationSlider.value)
我收到滾動誤差(也可用於詮釋等)
SettingViewController.swift:157:50: Cannot assign a value of type 'NSString!' to a value of type 'AnyObject?
'
甚至
self.pickerChoiceRow = currentuser.objectForKey("interestedCategoryRow") as! Int
我獲得以下錯誤信息:
SettingViewController.swift:82:36: Value of optional type 'PFUser?' not unwrapped; did you mean to use '!' or '?'?
而且這是不工作了:
if currentuser["job1_objectId"] != nil {
......
}
因爲我收到以下錯誤:
OverviewInsertViewController.swift:185:12: Binary operator '!=' cannot be applied to operands of type 'AnyObject?' and 'nil'
,這也是造成問題!
var 1_objectId:NSString! = ""
self.1_objectId = currentuser["job1_objectId"] as! NSString
var query_jobs = PFQuery(className: "Jobs")
query_jobs.getObjectInBackgroundWithId(self.1_objectId as String) {
(object: PFObject!, error: NSError!) -> Void in
if (error == nil) {
對於那些我收到以下錯誤行:
OverviewInsertViewController.swift:144:77: Cannot assign a value of type 'NSString' to a value of type 'NSString!'
OverviewInsertViewController.swift:146:32: Cannot invoke 'getObjectInBackgroundWithId' with an argument list of type '(String, (PFObject!, NSError!) -> Void)'
請幫助我,一切運行良好與老解析SDK?