适用于所有企业的MKLocalSearchRequest [英] MKLocalSearchRequest for all businesses
问题描述
另一位新手iOS开发人员.我已经通过使用request.naturalLanguageQuery ="Restaurants"使我的代码可以显示本地业务,但是我想返回所有业务.我不知道通配符是什么.好像会这么简单.任何帮助将不胜感激.
Another newbie iOS developer. I've got my code working to show local businesses by using request.naturalLanguageQuery = "Restaurants", but I want to return all businesses. I can't figure out what the wildcard character is. Seems like it would be so simple. Any help would be greatly appreciated.
var latitude:CLLocationDegrees = 40.7056258
var longitude:CLLocationDegrees = -73.97968
var latDelta:CLLocationDegrees = 0.01
var longDelta:CLLocationDegrees = 0.01
var span:MKCoordinateSpan = MKCoordinateSpanMake(latDelta, longDelta)
var location:CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, longitude)
var region:MKCoordinateRegion = MKCoordinateRegionMake(location, span)
mapView.setRegion(region, animated: true)
let request = MKLocalSearchRequest()
request.naturalLanguageQuery = "Restaurants"
request.region = mapView.region
推荐答案
我要说的是,鉴于naturalLanguageQuery
就是这种情况:
I'd say that given the fact that this is the case for naturalLanguageQuery
:
此属性不能为空.
This property can not be nil.
并且没有任何方式表明进行基于正则表达式的搜索,这是不可能的.我会为您的任务检查POI数据的另一个来源.
And no way is indicated to do a regex-based search, it's not possible. I'd check out another source of POI data for your task.
这篇关于适用于所有企业的MKLocalSearchRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!