<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>objective-d &#187; Code</title>
	<atom:link href="http://objective-d.com/?feed=rss2&#038;cat=8" rel="self" type="application/rss+xml" />
	<link>http://objective-d.com</link>
	<description>Mac and iPhone tomfoolery</description>
	<lastBuildDate>Fri, 03 Sep 2010 08:59:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Glossy Buttons</title>
		<link>http://objective-d.com/?p=218</link>
		<comments>http://objective-d.com/?p=218#comments</comments>
		<pubDate>Mon, 21 Sep 2009 23:16:21 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=218</guid>
		<description><![CDATA[Part 1 in a series on how to make glossy buttons in your iPhone applications.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mlsite.net/blog/?p=227">Part 1</a> in a series on how to make glossy buttons in your iPhone applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=218</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CoreLocation on a Mac</title>
		<link>http://objective-d.com/?p=216</link>
		<comments>http://objective-d.com/?p=216#comments</comments>
		<pubDate>Mon, 21 Sep 2009 21:47:50 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=216</guid>
		<description><![CDATA[Matt Gallagher has written a small sample app that demonstrates how to use CoreLocation in Snow Leopard. It&#8217;s interesting to see how some of the iPhone functionality is coming over onto the Mac&#8230;]]></description>
			<content:encoded><![CDATA[<p>Matt Gallagher has written a small sample app that demonstrates <a href="http://cocoawithlove.com/2009/09/whereismymac-snow-leopard-corelocation.html">how to use CoreLocation in Snow Leopard</a>.</p>
<p>It&#8217;s interesting to see how some of the iPhone functionality is coming over onto the Mac&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=216</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Free, open source iPhone code</title>
		<link>http://objective-d.com/?p=210</link>
		<comments>http://objective-d.com/?p=210#comments</comments>
		<pubDate>Mon, 21 Sep 2009 05:05:31 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=210</guid>
		<description><![CDATA[iPhoneDevCamp has a great list of free, open source iPhone libraries and applications. Among them are ARKit: an Augmented-Reality framework and OpenFlow: a CoverFlow replacement for Apple&#8217;s private CoverFlow API.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iphonedevcamp.org/2009/08/02/iphonedevcamp-3-hackathon-winners/">iPhoneDevCamp</a> has a great list of free, open source iPhone libraries and applications. </p>
<p>Among them are <a href="http://www.iphonear.org/">ARKit</a>: an Augmented-Reality framework and <a href="http://apparentlogic.com/openflow">OpenFlow</a>: a CoverFlow replacement for Apple&#8217;s private CoverFlow API.</p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=210</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Book News</title>
		<link>http://objective-d.com/?p=206</link>
		<comments>http://objective-d.com/?p=206#comments</comments>
		<pubDate>Mon, 21 Sep 2009 00:27:32 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=206</guid>
		<description><![CDATA[According to the Peachpit website, my book should be available for purchase in just over a week. I&#8217;ve made all the example code used in the book available for download here.]]></description>
			<content:encoded><![CDATA[<p><img src="images/iPhoneBookSmall.jpg" width="250" height="250"></p>
<p>According to the <a href="http://www.peachpit.com/store/product.aspx?isbn=0321669533">Peachpit website</a>, my book should be available for purchase in just over a week. I&#8217;ve made all the example code used in the book available for download <a href="http://objective-d.com/?page_id=160">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=206</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhoneDevTools</title>
		<link>http://objective-d.com/?p=169</link>
		<comments>http://objective-d.com/?p=169#comments</comments>
		<pubDate>Fri, 28 Aug 2009 22:29:08 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=169</guid>
		<description><![CDATA[A new site providing a directory of iPhone development tools.]]></description>
			<content:encoded><![CDATA[<p>A new site providing a <a href="http://iphonedevtools.com/">directory of iPhone development tools</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=169</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Snow Leopard developer news</title>
		<link>http://objective-d.com/?p=167</link>
		<comments>http://objective-d.com/?p=167#comments</comments>
		<pubDate>Fri, 28 Aug 2009 22:13:31 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=167</guid>
		<description><![CDATA[Jesper give us a summary of some of the Hidden Developer Gems in Snow Leopard. Marc Charbonneau has also found some articles on Snow Leopard for developers. Well worth a read..]]></description>
			<content:encoded><![CDATA[<p>Jesper give us a summary of some of the <a href="http://waffle.wootest.net/2009/08/28/hidden-developer-gems-in-snow-leopard/">Hidden Developer Gems in Snow Leopard</a>.</p>
<p>Marc Charbonneau has also found some articles on <a href="http://blog.mbcharbonneau.com/2009/08/28/snow-leopard-for-developers/">Snow Leopard for developers</a>.</p>
<p>Well worth a read..</p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=167</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cocoa Text System</title>
		<link>http://objective-d.com/?p=122</link>
		<comments>http://objective-d.com/?p=122#comments</comments>
		<pubDate>Tue, 26 May 2009 03:35:06 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=122</guid>
		<description><![CDATA[Aaron Hillegass talks about the Cocoa Text System: http://vimeo.com/4793853.]]></description>
			<content:encoded><![CDATA[<p>Aaron Hillegass talks about the Cocoa Text System:</p>
<p><a href="http://vimeo.com/4793853">http://vimeo.com/4793853</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=122</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Launching the iPhone maps application from your own code</title>
		<link>http://objective-d.com/?p=43</link>
		<comments>http://objective-d.com/?p=43#comments</comments>
		<pubDate>Thu, 13 Nov 2008 05:57:24 +0000</pubDate>
		<dc:creator>duncan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://objective-d.com/?p=43</guid>
		<description><![CDATA[[Update]: The iPhone 2.2. update seems to have broken url&#8217;s in the form: maps://maps.google.com/maps?q= however in my initial testing, it seems if you use http://maps.google.com/maps?q= (i.e. using http:// instead of maps://) then things still seem to function correctly &#8211; I&#8217;ve updated the post to reflect this. &#8212;&#8212;&#8212;&#8212; This week I spent some time playing around [...]]]></description>
			<content:encoded><![CDATA[<p><b>[Update]:</b> The iPhone 2.2. update seems to have broken url&#8217;s in the form: maps://maps.google.com/maps?q= however in my initial testing, it seems if you use http://maps.google.com/maps?q= (i.e. using http:// instead of maps://) then things still seem to function correctly &#8211; I&#8217;ve updated the post to reflect this.</p>
<p>&#8212;&#8212;&#8212;&#8212;</p>
<p>This week I spent some time playing around with the maps application on the iPhone and I thought I&#8217;d share some of my findings. (Note that since there is no maps application available in the iPhone simulator all of the below will be launched in Safari instead &#8211; you&#8217;ll have to actually run it on your iPhone to see it in the maps application.)</p>
<p>In it&#8217;s simplest form, to launch the maps application at your last location:</p>
<div style="margin-left:10px;">
  <code><br />
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"<span style="color:red">http://maps.google.com/maps</span>"]];<br />
  </code>
</div>
<p>which gives you something like this:</p>
<p>
<img src="images/maps1.jpg" width="320" height="480" border="0" /><br />
</p>
<p>Getting slightly more interesting, we can specify the <strong>latitude/longitude</strong> (&#8220;<strong>ll</strong>&#8220;) flag to tell the maps application to launch at a specific location (in this case, my workplace):</p>
<div style="margin-left:10px;">
  <code><br />
	NSString *latlong = @"-33.874559,151.219575";<br />
    <br />
	NSString *url = [NSString stringWithFormat: @"<span style="color:red">http://maps.google.com/maps?ll=%@</span>",<br />
					 [latlong stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];<br />
	<br />
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];<br />
  </code>
</div>
<p>results in:</p>
<p>
<img src="images/maps2.jpg" width="320" height="480" border="0" /><br />
</p>
<p>If you want to get maps to show all the thai restaurants near you, you can specify the <strong>query</strong> (&#8220;<strong>q</strong>&#8220;) flag:</p>
<div style="margin-left:10px;">
  <code><br />
	NSString *name = @"thai";<br />
    <br />
	NSString *latlong = @"-33.874559,151.219575";<br />
    <br />
	NSString *url = [NSString stringWithFormat: @"<span style="color:red">http://maps.google.com/maps?q=%@&#038;mrt=yp&#038;ll=%@</span>",<br />
					 [name stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],<br />
					 [latlong stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];	<br />
	[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];<br />
  </code>
</div>
<p>will give you:</p>
<p>
<img src="images/maps3.jpg" width="320" height="480" border="0" /><br />
</p>
<p>Note that in this example, I&#8217;ve include the <strong>search mode</strong> (&#8220;<strong>mrt</strong>&#8220;) flag, with a value of &#8220;<strong>yp</strong>&#8221; &#8211; this tells maps to search only for businesses &#8211; although this is of course not necessary.</p>
<p>Other interesting parameters include the <strong>zoom</strong> (&#8220;<strong>z</strong>&#8220;) flag zoom-level (1-19 defaults is 17 I believe &#8211; maps will intelligently alter the zoom level if you specify a query):</p>
<div style="margin-left:10px;">
  <code><br />
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"<span style="color:red">http://maps.google.com/maps?z=8</span>"]];<br />
  </code>
</div>
<p>zooms out from the previous map: </p>
<p>
<img src="images/maps4.jpg" width="320" height="480" border="0" /><br />
</p>
<p>and the ability to change the map type using the map type (&#8220;t&#8221;) flag (options are &#8220;m&#8221;-map, &#8220;k&#8221;-satellite, &#8220;h&#8221;- hybrid):</p>
<div style="margin-left:10px;">
  <code><br />
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"<span style="color:red">http://maps.google.com/maps?t=k</span>"]];<br />
  </code>
</div>
<p>shows the map in satellite mode:</p>
<p>
<img src="images/maps5.jpg" width="320" height="480" border="0" /><br />
</p>
<p>Last, but certainly not least &#8211; it&#8217;s actually possible to get the maps application to show with your own set of pins dropped on it (rather than using google&#8217;s search results as above). In order to do this, you will need to provide a KML file (KML &#8211; &#8220;Keyhole Markup Language&#8221; is a standard for representing geographic annotation &#8211; more information can be found <a href="http://en.wikipedia.org/wiki/KML">here</a>). </p>
<p>This is again done using the <strong>query</strong>(&#8220;<strong>q</strong>&#8220;) flag, but this time you pass in the url of your KML file:</p>
<div style="margin-left:10px;">
  <code><br />
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"<span style="color:red">http://maps.google.com/maps?q=http://objective-d.com/sample.kml</span>"]];<br />
  </code>
</div>
<p>(in this example, I only have a single entry in my KML file &#8211; you can view the file here: <a href="http://objective-d.com/sample.kml">http://objective-d.com/sample.kml</a>):</p>
<p>
<img src="images/maps6.jpg" width="320" height="480" border="0" /><br />
</p>
<p>This has just been a taster of the kind of control you have over the maps application, but hopefully it&#8217;s got you interested enough to start playing around. </p>
<p>For more information I suggest you check out the handy reference available here: <a href="http://mapki.com/index.php?title=Google_Map_Parameters">http://mapki.com/index.php?title=Google_Map_Parameters</a>.</p>
<p>If you are interested in including a map from <strong>within</strong> your iPhone applications, I encourage you to take a look at the <a href="http://code.google.com/p/iphone-google-maps-component/">iphone-google-maps-component</a> and <a href="http://code.google.com/p/route-me/">route-me</a> projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://objective-d.com/?feed=rss2&amp;p=43</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>
