我目前使用MSSQL查询,允许我查找特定半径的项目。 它看起来像这样:
select distinct ID,longitude,latitude,
(@unite * ACOS(cos(radians(@latitude))*cos(radians(latitude))*cos(radians(longitude)
-radians(@longitude))+sin(radians(@latitude))*sin(radians(latitude)))) as distance
from myTable
where (@unite * ACOS(cos(radians(@latitude))*cos(radians(latitude)) *
cos(radians(longitude)-radians(@longitude))+
sin(radians(@latitude))*sin(radians(latitude))))<@radius
我想知道是否可以将此查询转换为Objective C(我在我的应用程序中使用CoreData,并且我有超过8 000条记录)。