AVgepoint.geopointForCurrentLocationInBackground( )括号里的参数怎么写?

var point = AVGeoPoint.geoPointForCurrentLocationInBackground( ((AVGeoPoint!,NSError!) -> Void)!)
query.limit = 30
query,wherKey("location",nearGeopoint:point,withinKilometers:20)

其中括号中的 ((AVGeoPoint!,NSError!) -> Void)! 是出现的提示代码,求问括号里的参数具体应该怎么写?

阅读 2.6k
2 个回答

(AVGeoPoint!,NSError!) -> Void) 这是需要你传一个函数进去,可以直接用匿名函数(闭包)
{ (point, error) -> Void in

    //数据处理

}

请问这个方法是系统的吗 AVGeoPoint.geoPointForCurrentLocationInBackground

这样写参数是一个函数指针

推荐问题