ios - 将CLLocationCoordinate2D转换为PFGeoPoint吗?

标签 ios objective-c parse-platform geopoints cllocationcoordinate2d

我使用CLLocationCoordinate2D获取用户的当前位置,然后将其用于Parse的nearGeoPoint。

我知道我可以简单地使用geoPointForCurrentLocationInBackground,但是我宁愿使用CLLocationCoordinate2D进行检索。

最佳答案

您可以使用PFGeoPoint类的geoPointWithLatitude:longitude:初始化程序。为其指定CLLocationCoordinate2D的纬度和经度值,即可获得PFGeoPoint。

例如

PFGeoPoint *geoPoint = [PFGeoPoint geoPointWithLatitude:coordinate.latitude longitude:coordinate.longitude];

关于ios - 将CLLocationCoordinate2D转换为PFGeoPoint吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31915377/

相关文章:

ios - 默认情况下直接添加到数组

ios - 多个整数——它们不同时工作(Obj-C)

ios - UITableViewCells 恢复为默认值或其他值

ios - 如何使用 swift 在 parse.com 中检索模型

iphone - 在 Nib 或代码中设计 iPhone 界面?

iphone - 越狱 iOS 的命令行程序在 iPad 中死亡,但在 iPhone 3G 中没有

ios - 以编程方式创建 segue

ios - 用于类消息的 Objective-C 宏

ios - 该应用程序在 payload/appname.app/appname : _terminateWithStatus 中引用了非公共(public)选择器

arrays - 将 Parse 数据检索到数组时出错