2015-06-22 70 views
0

我已经尝试了一切。无论我的Geopoints在使用xcode或模拟器使用实际设备时都不会保存什么。解析和快速Geopoints不保存

if signUpError == nil { 
    PFGeoPoint.geoPointForCurrentLocationInBackground { 
    (geoPoint: PFGeoPoint?, error: NSError?) -> Void in 
    if error == nil { 
     PFUser.currentUser()!.setValue(geoPoint, forKey: "location") 
     } 
} 

我不确定该怎么做。

回答

0

那是因为你设置它,但你不保存您刚才设置的值:

if signUpError == nil { 
    PFGeoPoint.geoPointForCurrentLocationInBackground { 
    (geoPoint: PFGeoPoint?, error: NSError?) -> Void in 
    if error == nil { 
     PFUser.currentUser()!.setValue(geoPoint, forKey: "location") 
     PFUser.currentUser().saveInBackground() 
     } 
} 
+0

我很高兴,你从那么多压力过东西,所以小 – user2967062

+0

救了我@ user2967062我们都在那里,很高兴我能帮上忙。祝你好运完成你的应用! – Icaro