我目前使用一个 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条记录)。