我试图在Parse中获取currentUser的位置。用户是匿名用户,使用AppDelegate中的以下代码创建:
//log in the anonymous user
PFUser.enableAutomaticUser()
PFUser.currentUser()!.incrementKey("RunCount")
PFUser.currentUser()!.saveInBackground()
PFGeoPoint.geoPointForCurrentLocationInBackground {
(geoPoint: PFGeoPoint?, error: NSError?) -> Void in
if let geoPoint = geoPoint {
PFUser.currentUser()?["location"] = geoPoint
PFUser.currentUser()?.saveInBackground()
}
}
创建用户但在单步执行代码时跳过PFGeoPoint.geoPointForCurrentLocationInBackground
块。为了保存匿名的currentUser的位置,我还需要做些什么吗?
谢谢!