在iPhone中的地图中显示当前位置的标题 [英] To display the title for the current loaction in map in iphone
问题描述
我是iPhone开发的新手.我已经创建了地图应用程序,并显示了当前位置,并将图钉放置到当前位置.现在,我想在单击图钉时显示当前位置的标题和副标题.请帮帮我.
I am new to iphone development. I have created map applications and i displayed the cuurent locations and drop a pin to the current location. now i want to display the title and subtitle of the current location when i am clicking the pin. Please help me out.
谢谢.
推荐答案
要显示标题和字幕,添加到地图的注释对象必须响应-title
和-subTitle
消息(在MKAnnotation
协议中定义为可选) .
To display title and subtitle your annotation object you add to map must respond to -title
and -subTitle
messages (defined in MKAnnotation
protocol as optional).
您还可以使用MKReverseGeocoder
类获取有关给定位置的信息,该类查询基于google的服务并通过其委托返回数据(请参见MKReverseGeocoderDelegate
协议).
You can also obtain information about given location using MKReverseGeocoder
class that queries google based servises for that and returns data via its delegate (see MKReverseGeocoderDelegate
protocol).
这篇关于在iPhone中的地图中显示当前位置的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!