<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How-To: Detect when MKAnnotation, MKAnnotationView is selected</title>
	<atom:link href="http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html</link>
	<description>Tech tips, hints, and general musings. PHP, Perl, Mysql, Javascript, AJAX, JSON, Linux, Mac OSX</description>
	<lastBuildDate>Sun, 25 Jul 2010 04:36:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: joseph</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1701</link>
		<dc:creator>joseph</dc:creator>
		<pubDate>Mon, 28 Jun 2010 10:13:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1701</guid>
		<description>James I have the same problem,

Did you resolved it?</description>
		<content:encoded><![CDATA[<p>James I have the same problem,</p>
<p>Did you resolved it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lepah</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1676</link>
		<dc:creator>lepah</dc:creator>
		<pubDate>Wed, 28 Apr 2010 01:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1676</guid>
		<description>very handy, works well. thanks!!</description>
		<content:encoded><![CDATA[<p>very handy, works well. thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruno</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1647</link>
		<dc:creator>Bruno</dc:creator>
		<pubDate>Tue, 09 Mar 2010 16:01:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1647</guid>
		<description>Great post man ! Thank&#039;s a lot. 
I&#039;ve seen many ways on the net to do this, all very very more complicated!

Thank you Very much.</description>
		<content:encoded><![CDATA[<p>Great post man ! Thank&#8217;s a lot.<br />
I&#8217;ve seen many ways on the net to do this, all very very more complicated!</p>
<p>Thank you Very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Custom callout bubble in MKMapView, final solution! &#171; JAKERI</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1545</link>
		<dc:creator>Custom callout bubble in MKMapView, final solution! &#171; JAKERI</dc:creator>
		<pubDate>Sun, 06 Dec 2009 13:21:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1545</guid>
		<description>[...] is a combination of the property change listener solution and moving the calloutOffset off the [...]</description>
		<content:encoded><![CDATA[<p>[...] is a combination of the property change listener solution and moving the calloutOffset off the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: james</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1511</link>
		<dc:creator>james</dc:creator>
		<pubDate>Tue, 17 Nov 2009 19:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1511</guid>
		<description>Hi, Thanks for the tip but i am having this problem,
i used it to show several annotation images on map and when user touchs on one of it, it opens another view but when i go back and touch the same annotation it does not open the view again, it opens when i touch it after clicking on the map or another annotation.

i tried to call [ann setSelected:NO animated:NO]; in this method but no way. 
I want to use it because i dont wantto show callout just the image and touch it.

i tried it workaroud it by removing the annotation and adding it again, but at 3.1.2 SDK removing annotation releases it so it crashes.

Do you have a solution for the problem.

Thanks</description>
		<content:encoded><![CDATA[<p>Hi, Thanks for the tip but i am having this problem,<br />
i used it to show several annotation images on map and when user touchs on one of it, it opens another view but when i go back and touch the same annotation it does not open the view again, it opens when i touch it after clicking on the map or another annotation.</p>
<p>i tried to call [ann setSelected:NO animated:NO]; in this method but no way.<br />
I want to use it because i dont wantto show callout just the image and touch it.</p>
<p>i tried it workaroud it by removing the annotation and adding it again, but at 3.1.2 SDK removing annotation releases it so it crashes.</p>
<p>Do you have a solution for the problem.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Custom callout bubble to MKMapView in iPhone &#171; JAKERI</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1493</link>
		<dc:creator>Custom callout bubble to MKMapView in iPhone &#171; JAKERI</dc:creator>
		<pubDate>Sun, 01 Nov 2009 21:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1493</guid>
		<description>[...] solution (almost) might be to use a property change listener for the selected value. Unfortunately, the selected property is only changed if you have a title [...]</description>
		<content:encoded><![CDATA[<p>[...] solution (almost) might be to use a property change listener for the selected value. Unfortunately, the selected property is only changed if you have a title [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1481</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Sun, 25 Oct 2009 06:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1481</guid>
		<description>I&#039;m having a problem with this. If i have more than 1 pin on a map and the user selects a pin i display a subview over the top of my Map. then, when the user clicks the map all goes as planned and the subview disappears, BUT if a user clicks another pin, it fires the Observer 2 times. The first for the new selected pin and the second for the deselected pin.  Is there anyway to get it to fire in the reverse order? or get it to fire only 1 time?

Thanks</description>
		<content:encoded><![CDATA[<p>I&#8217;m having a problem with this. If i have more than 1 pin on a map and the user selects a pin i display a subview over the top of my Map. then, when the user clicks the map all goes as planned and the subview disappears, BUT if a user clicks another pin, it fires the Observer 2 times. The first for the new selected pin and the second for the deselected pin.  Is there anyway to get it to fire in the reverse order? or get it to fire only 1 time?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1480</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sat, 24 Oct 2009 20:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1480</guid>
		<description>I cannot get this to work at all, is it OBJ-C for iPhone?  I get errors for your extern line, the const line and even more for the adding the observer?</description>
		<content:encoded><![CDATA[<p>I cannot get this to work at all, is it OBJ-C for iPhone?  I get errors for your extern line, the const line and even more for the adding the observer?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uhhhno</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1267</link>
		<dc:creator>uhhhno</dc:creator>
		<pubDate>Sun, 16 Aug 2009 23:05:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1267</guid>
		<description>touchesBegan is ok when you just want to detect when an annotation is selected. However, if you want to also detect when it is deselected (by tapping on the surrounding area, for example), you need the observer above.</description>
		<content:encoded><![CDATA[<p>touchesBegan is ok when you just want to detect when an annotation is selected. However, if you want to also detect when it is deselected (by tapping on the surrounding area, for example), you need the observer above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hubert</title>
		<link>http://blog.evandavey.com/2009/07/how-to-detect-when-mkannotation-mkannotationview-is-selected.html/comment-page-1#comment-1200</link>
		<dc:creator>Hubert</dc:creator>
		<pubDate>Fri, 31 Jul 2009 19:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.evandavey.com/?p=533#comment-1200</guid>
		<description>So I found a MUCH easier way to do this:

What I did was create an annotation view using the MKPinAnnotationView (to continue using the pin graphics), and in that class you can override the method:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;

Here&#039;s what the .h file looks like:
-----------MyAnnotation.h-----------------
@interface MyAnnotation : MKPinAnnotationView {
	//stuff here
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;

@end
------------------------------------------

With this you can put whatever you want in that touchesBegan method.  Here&#039;s where I found the info:
http://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html
and I clicked under &quot;inherits from&quot; to UIView to find that method. http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/cl/UIView

hope this helps</description>
		<content:encoded><![CDATA[<p>So I found a MUCH easier way to do this:</p>
<p>What I did was create an annotation view using the MKPinAnnotationView (to continue using the pin graphics), and in that class you can override the method:</p>
<p>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;</p>
<p>Here&#8217;s what the .h file looks like:<br />
&#8212;&#8212;&#8212;&#8211;MyAnnotation.h&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
@interface MyAnnotation : MKPinAnnotationView {<br />
	//stuff here<br />
}</p>
<p>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;</p>
<p>@end<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>With this you can put whatever you want in that touchesBegan method.  Here&#8217;s where I found the info:<br />
<a href="http://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html" rel="nofollow">http://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html</a><br />
and I clicked under &#8220;inherits from&#8221; to UIView to find that method. <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/cl/UIView" rel="nofollow">http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/cl/UIView</a></p>
<p>hope this helps</p>
]]></content:encoded>
	</item>
</channel>
</rss>
