var point = AVGeoPoint.geoPointForCurrentLocationInBackground( ((AVGeoPoint!,NSError!) -> Void)!)query.limit = 30query,wherKey("location",nearGeopoint:point,withinKilometers:20)
其中括号中的 ((AVGeoPoint!,NSError!) -> Void)! 是出现的提示代码,求问括号里的参数具体应该怎么写?
光阴似箭催人老,日月如移越少年。
(AVGeoPoint!,NSError!) -> Void) 这是需要你传一个函数进去,可以直接用匿名函数(闭包){ (point, error) -> Void in
//数据处理
}
请问这个方法是系统的吗 AVGeoPoint.geoPointForCurrentLocationInBackground
这样写参数是一个函数指针
(AVGeoPoint!,NSError!) -> Void) 这是需要你传一个函数进去,可以直接用匿名函数(闭包)
{ (point, error) -> Void in
}
请问这个方法是系统的吗 AVGeoPoint.geoPointForCurrentLocationInBackground
这样写参数是一个函数指针