Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 检查CLPlacemark';她的名字是一个街道地址_Ios_Swift_Cllocation_Clplacemark - Fatal编程技术网

Ios 检查CLPlacemark';她的名字是一个街道地址

Ios 检查CLPlacemark';她的名字是一个街道地址,ios,swift,cllocation,clplacemark,Ios,Swift,Cllocation,Clplacemark,是否可以检查姓名是否为街道地址 如果是购物中心、主题公园、学校或其他有趣的地方,我想显示名称,但如果是街道地址,则不显示 我正在考虑使用这样的正则表达式来检查名称是否是街道地址 ^\d+([a-zA-Z0-9'-])+$ 但我觉得这不会一直奏效,尤其是在其他国家 有什么方法可以检查CLPlacemark的名称是否是街道地址,比如检查地名的大小,或者我必须使用第三方图书馆吗?试着对照CLPlacemark的大道(街道)和次大道(街道编号)检查名称 您还可以检查CLPlacemark属性“Area

是否可以检查姓名是否为街道地址

如果是购物中心、主题公园、学校或其他有趣的地方,我想显示名称,但如果是街道地址,则不显示

我正在考虑使用这样的正则表达式来检查名称是否是街道地址

^\d+([a-zA-Z0-9'-])+$
但我觉得这不会一直奏效,尤其是在其他国家


有什么方法可以检查CLPlacemark的名称是否是街道地址,比如检查地名的大小,或者我必须使用第三方图书馆吗?

试着对照CLPlacemark的
大道
(街道)和
次大道
(街道编号)检查
名称


您还可以检查CLPlacemark属性“AreaOfInterest”。这通常被标记为具有一般类别的区域,如机场、购物中心、学校、博物馆等


由于您希望删除本质上不属于感兴趣区域的任何内容,可能此字段将为您完成此工作?

谢谢您的建议,但是如果位置是房子,则
感兴趣区域也会显示一个地址。:(哦,值得一试!谢谢,我将检查
placemark.name==”\(placemark.Subthroughway)\(placemark.Throughway)“
var placemark: CLPlacemark
if placemark.name.rangeOfString(placemark.thoroughfare) != nil
    && placemark.name.rangeOfString(placemark.subThoroughfare) != nil {
        println("Name is likely the same as address")
} else {
    println("Name is distinct from street address")
}