简体   繁体   English

MKLocalSearch结果的唯一ID?

[英]Unique ID of MKLocalSearch result?

My App shows the result of a MKLocalSearch query. 我的应用程序显示MKLocalSearch查询的结果。

The user can select such a place and say 'I like this place'. 用户可以选择这样的地方并说“我喜欢这个地方”。

When the user searches again (after closing the App), how can my App know that the user already likes this place? 当用户再次搜索(关闭应用程序后)时,我的应用程序如何知道用户已经喜欢这个地方?

Is there something in the result that does not depend on the locale (the same at the next search) and unique (not shared by another place at the same location) 结果中是否存在不依赖于语言环境(在下一次搜索中相同)且唯一(不被同一位置的其他地方共享)的某些内容

        let request = MKLocalSearchRequest()
        request.region = mapView.region
        request.naturalLanguageQuery = query
        let search = MKLocalSearch(request: request)
        search.start { (response, error) in
            // do I know some items in the response?
        }

您应该将电话号码取回作为响应的一部分,您可以将其用作位置的唯一ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM