<?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>richard hyland</title>
	<atom:link href="http://www.richardhyland.com/diary/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richardhyland.com/diary</link>
	<description>random ramblings of a web, windows and iphone developer, oh and amateur photographer</description>
	<lastBuildDate>Mon, 01 Aug 2011 14:45:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<cloud domain='www.richardhyland.com' port='80' path='/diary/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>User Location and your own annotations in a MKMapView</title>
		<link>http://www.richardhyland.com/diary/2011/08/01/user-location-and-your-own-annotations-in-a-mkmapview/</link>
		<comments>http://www.richardhyland.com/diary/2011/08/01/user-location-and-your-own-annotations-in-a-mkmapview/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 14:41:49 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=629</guid>
		<description><![CDATA[I&#8217;ve spend a while working this one out. For a long time I&#8217;ve had a MKMapView to display pins dropped in specific places on a map. I&#8217;ve done this through the delegate method -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id) annotation { MKPinAnnotationView *annotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil]; // Some customisation goes here [annotation autorelease]; return annotation; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spend a while working this one out.</p>
<p>For a long time I&#8217;ve had a MKMapView to display pins dropped in specific places on a map.</p>
<p>I&#8217;ve done this through the delegate method</p>
<pre name="code">-(MKAnnotationView *)mapView:(MKMapView *)mapView  viewForAnnotation:(id) annotation {
  MKPinAnnotationView *annotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil];
 // Some customisation goes here
 [annotation autorelease];
 return annotation;
}</pre>
<p>That&#8217;s all very will but then I decided it&#8217;d be nice to show the user&#8217;s current location on the map as well, you know the lovely blue pin with accuracy circle around it.  </p>
<p>Well enabling this looks very simple.  </p>
<pre class="cpp" name="code">mapView.showsUserLocation = YES;</pre>
<p>Now I have custom objects in my annotation subclasses so I can reference them easily later. With this, however, if you compile and try to run, when the view loads you&#8217;ll get a crash with this error to the debugger.</p>
<blockquote><p>-[MKUserLocation getTagId]: unrecognized selectory sent to instance</p></blockquote>
<p>It turns out the way to get this to work is to include at the top of the delegate method the following line</p>
<pre class="cpp" name="code">
if ([annotation isMemberOfClass:[MKUserLocation class]]) return nil;
</pre>
<p>Compile and run and all will work fine</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2011/08/01/user-location-and-your-own-annotations-in-a-mkmapview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why the iPad 2 will have a 2058&#215;1536 resolution</title>
		<link>http://www.richardhyland.com/diary/2011/01/21/why-the-ipad-2-will-have-a-2058x1536-resolution/</link>
		<comments>http://www.richardhyland.com/diary/2011/01/21/why-the-ipad-2-will-have-a-2058x1536-resolution/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 10:27:14 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=602</guid>
		<description><![CDATA[Let me take you back to the old iPhone 2G, 3G and 3Gs. This device had a screen resolution of 320 pixels wide by 480 pixels high. Developers were explicitly told to code for that resolution and did so with great success. This immediately raised a concern for me, what would happen in the future, [...]]]></description>
			<content:encoded><![CDATA[<p>Let me take you back to the old iPhone 2G, 3G and 3Gs.  This device had a screen resolution of 320 pixels wide by 480 pixels high.</p>
<p>Developers were explicitly told to code for that resolution and did so with great success. This immediately raised a concern for me, what would happen in the future, when Apple would release a new device with a higher resolution, something they surely would?</p>
<p>Well along with many other iPhone fans we heard the keynote from Steve Jobs announcing the Retina display for the iPhone 4.  This had a resolution of 640&#215;960.  It left a number of people, developers, etc wondering how they would support both the existing iPhone and the new iPhone 4 in their apps.</p>
<p>As I wrote in a <a href="http://www.richardhyland.com/diary/2010/07/15/how-to-harness-the-retina-display-in-your-app/">previous post</a>, Apple actually pulled off something very remarkable and very clever with the Retina Display.  They kept the screen ratio exactly the same, and made the screen exactly twice as big.</p>
<p>Assets in iPhone applications not &#8216;Retina Compatible&#8217; simply had all of their graphical assets doubled up in size.  320 pixels wide became 320 points wide and so on.</p>
<p>How did a developer support the retina display, why they simply added an image of the same ratio, but exactly doubled to their app bundle but instead of a .png extension they added @2x.png to the end of the file with the same name.</p>
<p>It was incredibly simple to implement and required zero code changes whatsoever.</p>
<p><strong>iPad 2</strong></p>
<p>The iPad has a resolution of 1024&#215;768 which does look amazing but unfortunately for the iPad, the iPhone 4&#8242;s Retina Display was released only slightly after the iPad.</p>
<p>Now there has been lots of commentary as to what the resolution would be on the iPad 2, would they simply increase it slightly or would they change the ratio, etc.  There are commentators stating that a resolution of 2058&#215;1536 would be very unlikely due to memory requirements.</p>
<p>In my personal opinion, it&#8217;s actually incredibly unlikely we will see any other resolution other than either keeping the status quo of 1024&#215;768 or going for 2058&#215;1536.</p>
<p>If Apple were to release an iPad with a different screen ratio or not @2x, existing iPad apps would not fit the screen properly.</p>
<p>People will argue but Windows and OS X apps don&#8217;t worry about this, no they don&#8217;t but then they also weren&#8217;t explicity told your only option is to provide a full screen application like iOS developers are.</p>
<p>Apple could scale these, but from experience of using iPhone applications on the iPad, scaling tends to look terrible.</p>
<p>The reason I believe 2058&#215;1536 is likely, is first it has been found in the iOS 4.3 beta&#8217;s a number of iBook image assets with the @2x extension and are exactly doubled, but also that Apple can apply exactly the same logic as they did for the iPhone 4 and developers will have an option to support the new display or not without adversely affecting the layout of their App.</p>
<p>Additionally if we don&#8217;t have a double resolution we end up with the exact same type of fragmentation of iOS that Apple complains about the Android ecosystem.</p>
<p>Could it be called &#8216;Retina&#8217; as the pixel density probably isn&#8217;t high enough, well I don&#8217;t know.</p>
<p><em>* Image credit <a href="http://commons.wikimedia.org/wiki/File:IPad-02.jpg">Glenn Fleishman</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2011/01/21/why-the-ipad-2-will-have-a-2058x1536-resolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Logging in Obj-C</title>
		<link>http://www.richardhyland.com/diary/2010/12/07/custom-logging-in-obj-c/</link>
		<comments>http://www.richardhyland.com/diary/2010/12/07/custom-logging-in-obj-c/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 18:59:37 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=596</guid>
		<description><![CDATA[If you&#8217;ve used Objective-C for Mac or iOS development you&#8217;re probably familiar with NSLog(); to log to the console. Well that is fantastic for development, but you don&#8217;t really want to output your debugging logs on distributed iOS apps do you? It would be a real pain to remove every instance of NSLog from your [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve used Objective-C for Mac or iOS development you&#8217;re probably familiar with NSLog(); to log to the console.</p>
<p>Well that is fantastic for development, but you don&#8217;t really want to output your debugging logs on distributed iOS apps do you?</p>
<p>It would be a real pain to remove every instance of NSLog from your code everytime you wish to distribute your app.  Well you can solve this with a custom logger.</p>
<p>In your Prefix.pch file add the following bit of code</p>
<pre class="cpp" name="code">
#ifdef DEBUG
#  define RHLog(...) NSLog(__VA_ARGS__)
#else
#  define RHLog(...) ;
#endif
</pre>
<p>Then whenever DEBUG is set (either by adding DEBUG to your pre-processor macros, or using the -DDEBUG flag) instead of calling </p>
<pre class="cpp" name="code">NSLog(@"String: %@", stringValue);</pre>
<p>you can call</p>
<pre class="cpp" name="code">RHLog(@"String: %@", stringValue);</pre>
<p>And when in debug mode the string will log to the console, in Release, Ad-Hoc and Distribution builds it won&#8217;t</p>
<p>However you can go one further than this and actually produce a much nicer logging function using </p>
<pre class="cpp" name="code">#ifdef DEBUG
#   define RHLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define RHLog(...)
#endif</pre>
<p>and when you call your function like so</p>
<pre class="cpp" name="code">RHLog(@"Testing");</pre>
<p>You&#8217;ll see the following in your console</p>
<pre class="cpp" name="code">-[AppDelegate startup] [Line 123] Testing</pre>
<p><em>* Image Credit <a href="http://commons.wikimedia.org/wiki/File:Bildschirmfoto_2010-08-05_um_20.56.34.png">Fryhstyxei</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2010/12/07/custom-logging-in-obj-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to harness the Retina Display in your app</title>
		<link>http://www.richardhyland.com/diary/2010/07/15/how-to-harness-the-retina-display-in-your-app/</link>
		<comments>http://www.richardhyland.com/diary/2010/07/15/how-to-harness-the-retina-display-in-your-app/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 23:00:42 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=585</guid>
		<description><![CDATA[It is remarkably easy to do so and I implore all all iPhone developers to please upgrade all their apps to support the Retina Display on the iPhone 4, otherwise your app just looks blurry. What Apple achieved with the Retina Display is a remarkable feat. The screen is still exactly the same size of [...]]]></description>
			<content:encoded><![CDATA[<p>It is remarkably easy to do so and I implore all all iPhone developers to please upgrade all their apps to support the Retina Display on the iPhone 4, otherwise your app just looks blurry.</p>
<p>What Apple achieved with the Retina Display is a remarkable feat. The screen is still exactly the same size of 3.5 inches but where you used to have 1 pixel you now have 4.  This means UI elements are scaled exactly by 2.</p>
<p>Developers were always told to design for a screen resolution of 320&#215;480 pixels, so don&#8217;t I need to change my UIViewControllers to have a different size?</p>
<p>Well no, and this is how Apple have been incredibly clever. The screen dimensions are now 320&#215;480 points, and not pixels so in your UIViewController you still have the size 320&#215;480. With me so far?</p>
<p><strong>Images</strong></p>
<p>Ok so lets say I have an image that needs to span the width of the screen and is only 100 pixels high on an iPhone 3G or 3Gs we simply embed an image of 320pixels by 100pixels.  So that image that we&#8217;ve called banner.png, for example, looks perfect on those old devices but they look blurry on the iPhone 4.</p>
<p>I can hear you asking, if the screen is 320points wide but is actually 640pixels wide, how do I provide both an iPhone 4 and iPhone 3G(s) version of this and how much code does it take.</p>
<p>Well my answer is, very easy and zero, that&#8217;s right, <strong>zero</strong> code modifications.</p>
<p>Now you did have a high resolution, or vector version of your artwork right? Ok well open it up and scale it to exactly double the size of the original file. So you&#8217;ll now have an image that is 640&#215;200 pixels and save it as banner@2x.png (as the original was called banner.png). Add the new image to your resources in your XCode project.</p>
<p>You can call your image in exactly the same way as before</p>
<pre class="cpp" name="code">UIImageView *myImage = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,100)];
[myImage setImage:[UIImage imageNamed:@"banner.png"]];
[self.view addSubview:myImage];
[myImage release];</pre>
<p>When you run your app on your iPhone 4 (or the iPhone 4) simulator the image will magically use the banner@2x.png version instead.  Clever isn&#8217;t it!</p>
<p><strong>Default splash images</strong></p>
<p>This is exactly the same as for images, just include a Default@2x.png image in your bundle and the iPhone 4 will use it instead.</p>
<p><strong>Springboard App Icon</strong></p>
<p>Ok now this one is a little more complicated, but not by much.  If you&#8217;ve already designed a Universal (iPhone and iPad) app then you&#8217;ll be familiar with this technique, and actually there are a couple of ways to do it but I&#8217;ll explain the one from the Apple Docs.</p>
<p>If you want to still provide support to iOS 3.1.x and below you&#8217;ll still need a</p>
<pre class="cpp" name="code">CFBundleIconFile</pre>
<p>with Icon.png in it for your Info.plist but you should now also include an array entry of</p>
<pre class="cpp" name="code">CFBundleIconFiles</pre>
<p>Include an Icon.png file, this is your non-iPhone 4 57&#215;57 file<br />
Include an Icon@2x.png file, this is your iPhone 4 114&#215;114 file.</p>
<p>Yep once again it really is that simple.</p>
<p><strong>Conclusion</strong></p>
<p>If you have an app that simply uses SDK UI Elements and/or images, which the majority of iPhone app do, then you simply have no excuse not to support the Retina Display&#8230; so what are you waiting for, go cut graphics and submit!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2010/07/15/how-to-harness-the-retina-display-in-your-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The iPhone App Piracy Problem</title>
		<link>http://www.richardhyland.com/diary/2010/08/18/the-iphone-app-piracy-problem/</link>
		<comments>http://www.richardhyland.com/diary/2010/08/18/the-iphone-app-piracy-problem/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 07:07:11 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=589</guid>
		<description><![CDATA[The iOS (that&#8217;s the iPhone, iPad and iPod Touch) AppStore has a problem. A piracy problem. If you have a jailbroken iPhone, that is one where you have run a bit of software to allow you to download apps outside of the AppStore then you may have come across pirated apps, you may not have [...]]]></description>
			<content:encoded><![CDATA[<p>The iOS (that&#8217;s the iPhone, iPad and iPod Touch) AppStore has a problem.</p>
<p>A piracy problem.</p>
<p>If you have a jailbroken iPhone, that is one where you have run a bit of software to allow you to download apps outside of the AppStore then you may have come across pirated apps, you may not have installed them but you&#8217;re probably aware of them.</p>
<p>Before I talk about the morality of piracy, let me address the question of why</p>
<h2>Why do pirates crack apps?</h2>
<p>This is an interesting question and to understand the piracy we must address the motivations</p>
<h3>1) Try before you buy</h3>
<p>I&#8217;ve heard this many times for people&#8217;s justifications as to why they crack apps.</p>
<p>Apple doesn&#8217;t offer any form of demo or free trial for Apps and so I can understand this motivation.  However there are two problems with this justification</p>
<ol>
<li>Many of the popular apps already provide a &#8216;try before you buy&#8217; in the form of a free &#8216;lite&#8217; app from the App Store itself</li>
<li>The conversion rate from cracked to paid is less than 0.5% (<a href="http://www.pinchmedia.com/blog/piracy-in-the-app-store-from-360idev/" target="_blank">source</a>)</li>
</ol>
<p>The conversion rate of cracked to paid is incredibly low which simply blows any form of arguement of try before you buy out of the water&#8230; it&#8217;s total rubbish.</p>
<p>Sure some of you out there have done so, and I applaud you for that, but unfortunately you are in the very small minority.</p>
<h3>2) A hatred of DRM</h3>
<p>DRM (or Digital Rights Management) is an encryption and licensing technique used on DVD&#8217;s, BluRays, some iTunes purchases, etc and Apps from the AppStore.</p>
<p>It&#8217;s a system, whether you like it or not, that restricts where you can and can&#8217;t install your purchase. How many times you can install it and then what you can do or modify in it once you have installed it.</p>
<p>Cracking an App on the iPhone removes this encryption and DRM.</p>
<p>Again I can understand this, if someone wants to remove the DRM and encryption for their own use, then for me this is fair enough and I have no problem with them doing this.</p>
<p>But how, I ask, did that app end up on file sharing sites and specialised cracked app repos.  Opps sorry you&#8217;ve lost your argument again.  The minute you share that DRM free version you&#8217;ve lost my respect again and you&#8217;ve breached my copyright.</p>
<h3>3) A fundamental belief that software should be free</h3>
<p>This is the last category and it&#8217;s either that the user has a belief that all software should be free or they simply don&#8217;t care about the law.</p>
<p>The former, is a belief that a number of people hold, however who are they to decide under what license my software should be released.  Did they write it? Do they own the copyright? <strong>NO</strong> they don&#8217;t. So they do <strong>NOT</strong> get to decide under what terms my software is available.</p>
<p>If they want to write their own software and release it for free I will defend their right to choose that path, but at the same time I will defend anyone who decides to charge for their software, as it is their right to do so.</p>
<h2>The rights of a developer</h2>
<p>A developer works, a developer has a family, a developer has a mortgage, a developer has taxes to pay, a developer has computers to purchase to develop on, a developer has software to purchase (developers don&#8217;t use pirated software to develop commercial software, that would be hypocritical wouldn&#8217;t it!), a developer has servers to license, domains to buy, food to put on the table.  Do you see where I am going with this.</p>
<p>That push notification feature you love, that scheduling feature you love so much.  A server is involved there and who pays for that? Well either the developer makes a loss paying for it, or legitimate customers have to pay more simply to cover the cost of you giving away the app for free.</p>
<p>A cracker in all likelyhood isn&#8217;t a developer, they probably have a job outside IT.</p>
<p>Think about it this way, if you work in an office and an intern comes in and claims credit for all your work and doesn&#8217;t get paid, but because they&#8217;ve claimed credit for all your work you don&#8217;t get paid either, in fact you get made redunant is that fair? Is that right? No of course it&#8217;s not.</p>
<p>Developers do not work for free, they have the same bills and financial outgoings as anyone else.  So a message to the app crackers who distribute cracked apps out there, what gives you the right to give away my software for free and prevent me from paying my mortgage this month? ABSOLUTELY NONE, you are thieves&#8230; end of story.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2010/08/18/the-iphone-app-piracy-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s iPad UK pricing</title>
		<link>http://www.richardhyland.com/diary/2010/05/08/apples-ipad-uk-pricing/</link>
		<comments>http://www.richardhyland.com/diary/2010/05/08/apples-ipad-uk-pricing/#comments</comments>
		<pubDate>Sat, 08 May 2010 08:47:57 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=583</guid>
		<description><![CDATA[I&#8217;ve read a lot of comments online since Apple announced it&#8217;s international iPad pricing, and most of those comments revolve around &#8216;Rip-Off Britain&#8217;. Now it is true that must tech imported from the USA seems to cost more with this mythical international tax and at first glance the iPad pricing in the UK is a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve read a lot of comments online since Apple <a href="http://www.apple.com/uk/pr/library/2010/05/07ipad.html" target="_blank">announced</a> it&#8217;s international iPad pricing, and most of those comments revolve around &#8216;Rip-Off Britain&#8217;.</p>
<p>Now it is true that must tech imported from the USA seems to cost more with this mythical international tax and at first glance the iPad pricing in the UK is a lot more but let&#8217;s break it down for the 16Gb WiFi iPad.</p>
<p>In the US this is $499. The UK price announced is £429.  At a direct comparison at today&#8217;s exchange rates of 1.48, that comes to $648.  Wow that seems an awful lot more.  However that simply isn&#8217;t a fair comparison.</p>
<p>In the US all prices exclude sales tax which our friends in America accept is always added at point of sale and calculate the price in their head all the time.  In the UK we have VAT so the tax is always added (and at the moment it&#8217;s 17.5%).  So let&#8217;s take off the VAT from £429 and it comes to £365.</p>
<p>Convert that to USD and we see the UK iPad price is actually $540.  So the UK iPad is actually $41 more expensive in the UK than the US&#8230; that&#8217;s a whole £27, although yesterday it was £25.</p>
<p>I&#8217;m sure there are some import taxes or costs and £27 more isn&#8217;t really a lot of money, sure I&#8217;d prefer not to have to pay it but it isn&#8217;t what I&#8217;d call rip-off Britain compared with the US price.</p>
<p>If anyone is to blame it&#8217;s the level of VAT we get charged in the UK.</p>
<p>If we compare our £429 iPad with VAT to what it costs, in say California with federal and local sales tax of 10.75% we see that in the US the iPad costs $552.64 which is £373.</p>
<p>So the entire reason we feel we are being ripped off for our technology is nothing to do with Apple in this case and everything to do with the Government and our VAT.</p>
<p>Of course importing it isn&#8217;t a solution either, because you did remember to pay your VAT when it came through customs didn&#8217;t you?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2010/05/08/apples-ipad-uk-pricing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s delay to international iPad shipping and how it harms developers</title>
		<link>http://www.richardhyland.com/diary/2010/04/14/apples-delay-to-international-ipad-shipping-and-how-it-harms-developers/</link>
		<comments>http://www.richardhyland.com/diary/2010/04/14/apples-delay-to-international-ipad-shipping-and-how-it-harms-developers/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 13:27:51 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=581</guid>
		<description><![CDATA[Apple has today announced that they are delaying international shipping of the iPad until the end of May. As a user, and future owner of one of these devices I&#8217;m disappointed. As a developer, I&#8217;m angry and let me explain why.  International developers are now at a severe disadvantage to US based developers without great [...]]]></description>
			<content:encoded><![CDATA[<p>Apple has today announced that they are <a href="http://gizmodo.com/5516860/apple-delays-international-ipad-launch-by-one-month" target="_blank">delaying international shipping of the iPad</a> until the end of May.</p>
<p>As a user, and future owner of one of these devices I&#8217;m disappointed.</p>
<p>As a developer, I&#8217;m angry and let me explain why.  International developers are now at a severe disadvantage to US based developers without great expense to themselves, of finding a way to import the iPad from the USA.</p>
<p>US based developers have been able to see how their app looks, feels and works on a physical iPad whilst those of us not in the US have only had the simulator which is simply not good enough.  Anyone who has developed anything more than a one screen app for the iPhone will know that the simulator often behaves differently to the ARM architecture of the iPhone itself.</p>
<p>I&#8217;m not asking for Apple to give developers discounts, special advance access, free shipping, etc.  All I am asking is for Apple to allow a level playing field for developers and so that international developers that have PAID to register in the iPhone Developer Program should have a way of gaining access to the devices to be able to develop and test on.</p>
<p>At the moment there is no fair playing field between developers in the US and those of us who are not, of which I wouldn&#8217;t be surprised if there are more outside the US than in it.</p>
<p>Robert Scoble has written a great blog post on why <a href="http://scobleizer.com/2010/04/14/why-was-apples-prediction-on-ipads-so-wrong/" target="_blank">Apple&#8217;s prediction was so wrong</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2010/04/14/apples-delay-to-international-ipad-shipping-and-how-it-harms-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your rights as a photographer in the UK</title>
		<link>http://www.richardhyland.com/diary/2009/12/15/your-rights-as-a-photographer-in-the-uk/</link>
		<comments>http://www.richardhyland.com/diary/2009/12/15/your-rights-as-a-photographer-in-the-uk/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 14:13:38 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=577</guid>
		<description><![CDATA[As someone who is an amateur photographer and also as someone that has been stopped by the police for taking photos of public architecture in London I came across this post by Documental.ly The guide below is available to print out on the website PhotographerNotATerrorist.org I highly recommend carrying it with you in your camera bag [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Me taking a photo" src="http://www.richardhyland.com/headers/richard.jpg" alt="" width="205" height="154" />As someone who is an amateur photographer and also as someone that has been stopped by the police for taking photos of public architecture in London I came across this post by <a href="http://www.stumbleupon.com/su/1SUMDy/documental.ly/your-rights-as-a-photographer-in-the-uk" target="_blank">Documental.ly</a></p>
<p><span id="more-577"></span></p>
<p><span style="font-size: x-small;"><em><span style="font-family: Verdana;">The guide below is available to print out on the website <a href="http://photographernotaterrorist.org/bust-card/">PhotographerNotATerrorist.org</a></span></em></span><span style="font-size: x-small;"><em><span style="font-family: Verdana;"> </span></em></span></p>
<p><span style="font-size: x-small;"><em><span style="font-family: Verdana;">I highly recommend carrying it with you in your camera bag at all times.</span></em></span><span style="font-size: x-small;"><em><span style="font-family: Verdana;"> </span></em></span></p>
<p><span style="font-size: x-small;"><em><span style="font-family: Verdana;">Also make sure you follow <a href="http://twitter.com/phnat">@PHNAT</a> on twitter and join the <span style="font-family: Helvetica;"><a href="http://www.facebook.com/pages/Im-a-Photographer-Not-a-Terrorist/128534046017">Facebook group</a></span></span></em></span></p>
<div><span style="text-decoration: underline;"><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Your Rights As A Photographer In The UK</span></span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">If you are stopped and searched under section 44 of the Terrorism Act, you <strong>do not</strong> have to give your:</span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><br />
</span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Name, address, date of birth, <span style="font-family: Helvetica Neue; font-size: 10px;"><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">DNA or r</span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">eason for being there, n</span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">or do you have to explain where you are going.</span></span></span></span></span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><span style="font-family: Helvetica Neue; font-size: 10px;"><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><br />
</span></span></span></span></span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><strong>However</strong>, if the police decide that there is reasonable suspicion to arrest you for an offence, you do have to give your name and address.</span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><br />
</span></span></span></div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">You do not have to comply with any attempt to photograph you, although you cannot flee the scene</span></span></span></li>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span><span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">The Police cannot delete any images on your camera. They can only view them in very limited circumstances.</span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span></li>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">If you are driving a vehicle, when stopped you must give your name and address.</span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span></li>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Failure to stop or obstructing a police constable acting under section 44 is a criminal offence.</span></span></span></li>
</ul>
</div>
<div><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 14px;"> </span></span></p>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><strong>Police Power</strong></span></span></span></div>
<div></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Under s44, a police constable in uniform is entitled to:</span></span></span></div>
<div></div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Pat you down</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Detain you for the duration of the search</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Remove outer clothing</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Require you to remove any item which he reasonably believes you are wearing to conceal your identity</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Look through your pockets and anything you are carrying</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Seize any article he reasonably suspects is intended to be used in connection with terrorism</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Search your vehicle and anyone in it</span></span></span></li>
</ul>
</div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><strong>What You Should Do</strong></span></span></span></div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Insist on a written record of the search</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Make sure it is legible and includes details of the officers’ shoulder number and the reason for the stop.</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Note exactly why they said you were being stopped and searched – this may be more extensive than the reference in the record slip.</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Ask to see the officers’ warrant card and note the number. (This is useful when making a complaint if they have moved stations and their shoulder number changes)</span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span></li>
</ul>
</div>
<div>
<span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span><br />
<span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><strong>Note</strong></span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><strong><br />
</strong></span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">A Police Community Support Officer (PCSO) may not perform a s44 search without a police officer present.</span></span></span></div>
</div>
<p><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 14px;"> </span></span></p>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><strong>Other Laws</strong></span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><strong><br />
</strong></span></span></span></div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">It is not against the law to photograph police, vehicles or equipment, unless the images are </span></span></span><span style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">“</span></span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">likely to be useful to a person committing or preparing an act of terrorism”.</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">It is not against the law to take photographs in an area where an authority under section 44 is in place.</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Using a tripod or other equipment on a public right of way can be considered obstruction. Simply standing still on a public right of way (as to take a photo) can be deemed an obstruction in certain circumstances.</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Although it is rarely used, the Official Secrets Act prohibits photography that threatens the security of the state. This includes:</span></span></span></li>
</ul>
</div>
<div></div>
<div><span style="font-family: Lucida Grande; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><span>&gt;</span> </span></span></span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Military establishments and munitions stores, aircraft and ships</span></span></span></div>
<div><span style="font-family: Lucida Grande; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">&gt;</span></span></span><span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Civil Aviation property and naval dockyards</span></span></span></div>
<div><span style="font-family: Lucida Grande; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">&gt; </span></span></span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Railways, road, waterway, power stations, waterworks and nuclear power stations that have been defined as prohibited places by the Secretary of State.</span></span></span></div>
<div><span style="font-family: Lucida Grande; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">&gt;</span></span></span><span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Telephone exchanges and communications centres operated by the Crown</span></span></span></div>
<div><span style="font-family: Lucida Grande; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">&gt;</span></span></span><span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"> </span></span></span></span></span><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Anywhere else that is a prohibited place by order of the Secretary of State</span></span></span></div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">You can photograph private property if you are on public property or a public right of way</span></span></span></li>
</ul>
</div>
<p><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 14px;"> </span></span></p>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Private property owners may impose restrictions on photography, this only applies to photographs taken from somewhere on their property. Restrictions may not always be obvious but will still apply. They cannot be imposed after the photography has occurred.</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">Private property owners or their agents (for example security guards) may not view or delete images on your camera or demand your name and address. They may require you to leave immediately and by the most direct route without giving any reason if they choose.</span></span></span></li>
</ul>
</div>
<div>
<ul>
<li><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;">There is no right to privacy in a public place, however, there are circumstances in which a person has a reasonable expectation of privacy, particularly if they are inside their own home. Childrens privacy rights are particularly protected. You therefore need to be aware that publication without consent may leave you open to legal action.</span></span></span></li>
</ul>
</div>
<div><span style="font-size: medium;"><span style="font-size: 14px;"><span style="font-family: Verdana;"><br />
</span></span></span></div>
<div><span style="font-size: small;"><span><span><span style="font-family: Verdana;">Download the guide from</span></span></span><em><span style="font-family: Verdana;"> <a href="http://photographernotaterrorist.org/bust-card/">PhotographerNotATerrorist.org</a></span></em></span></div>
<div></div>
<div></div>
<div>
<div><span style="font-family: Verdana;"><em><span style="font-size: x-small;"><span style="font-size: 10px;">Disclaimer &#8211; While care has been taken to ensure that the information contained in this guide is accurate it does not provide a comprehensive in- depth discussion of the relevant law. The information it contains is of a general nature and is not intended to be legal advice. The guide is provided without warranty as to the accuracy of the information it contains. The author, publisher and distributor of this guide will not be held responsible for any loss suffered by any person that is directly or indirectly attributable to reliance on the information contained in this guide.</span></span></em></span></div>
<div><span style="font-family: Verdana;"><em><span style="font-size: x-small;"><span style="font-size: 10px;">This guide was compiled by David Hoffman, Marc Vallée and Jonathan Warren with additional legal advice from Anna Mazolla at Hickman &amp; Rose.</span></span></em></span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/12/15/your-rights-as-a-photographer-in-the-uk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add a pin to embedded map</title>
		<link>http://www.richardhyland.com/diary/2009/10/27/how-to-add-a-pin-to-embedded-map/</link>
		<comments>http://www.richardhyland.com/diary/2009/10/27/how-to-add-a-pin-to-embedded-map/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 09:17:10 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=555</guid>
		<description><![CDATA[Part one of this section on MapKits showed how to embed a map and place a floating toolbar for switching the map views, however it didn&#8217;t cover how to drop the pin where you wanted it. Create the Object First lets create a new NSObject for the place mark. Let&#8217;s call it &#8216;PlaceMark&#8217; PlaceMark.h #import [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.richardhyland.com/diary/2009/10/17/how-to-embed-a-map-on-the-iphone/">Part one</a> of this section on MapKits showed how to embed a map and place a floating toolbar for switching the map views, however it didn&#8217;t cover how to drop the pin where you wanted it.<br />
<img class="aligncenter size-full wp-image-547" title="MKMapKit" src="http://www.richardhyland.com/diary/wp-content/uploads/2009/10/map.png" alt="MKMapKit" width="320" height="412" /></p>
<h2>Create the Object</h2>
<p>First lets create a new NSObject for the place mark. Let&#8217;s call it &#8216;PlaceMark&#8217;</p>
<p><em>PlaceMark.h</em></p>
<pre class="cpp" name="code">
#import &lt;Foundation/Foundation.h&gt;
#import &lt;MapKit/MapKit.h&gt;

@interface PlaceMark : NSObject<MKAnnotation> {
	CLLocationCoordinate2D coordinate;
	NSString *subtitletext;
	NSString *titletext;
}
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (readwrite, retain) NSString *titletext;
@property (readwrite, retain) NSString *subtitletext;
-(id)initWithCoordinate:(CLLocationCoordinate2D) coordinate;
- (NSString *)subtitle;
- (NSString *)title;
-(void)setTitle:(NSString*)strTitle;
-(void)setSubTitle:(NSString*)strSubTitle;

@end
</pre>
<p><em>PlaceMark.m</em></p>
<pre class="cpp" name="code">
#import "PlaceMark.h"

@implementation PlaceMark
@synthesize coordinate, titletext, subtitletext;

- (NSString *)subtitle{
	return subtitletext;
}
- (NSString *)title{
	return titletext;
}

-(void)setTitle:(NSString*)strTitle {
	self.titletext = strTitle;
}

-(void)setSubTitle:(NSString*)strSubTitle {
	self.subtitletext = strSubTitle;
}

-(id)initWithCoordinate:(CLLocationCoordinate2D) c{
	coordinate=c;
	return self;
}
@end
</pre>
<h2>Adding a pin to your map</h2>
<p>Firstly remember to add</p>
<pre class="cpp" name="code">
#import "PlaceMark.h"
</pre>
<p>To your map controller, from the previous example inside the displayMap function under the region.center call</p>
<pre class="cpp" name="code">
PlaceMark *addAnnotation = [[[PlaceMark alloc] initWithCoordinate:location] retain];
[addAnnotation setTitle:@"The Pin Title"];
[addAnnotation setSubTitle:@"The pin subtitle goes here"];

[mapView addAnnotation:addAnnotation];
</pre>
<p>Then create the following delegate method</p>
<pre name="code" class="cpp">
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;) annotation{
    MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"MyPin"];
    annView.animatesDrop=TRUE;
    annView.canShowCallout = YES;
	[annView setSelected:YES];
	annView.pinColor = MKPinAnnotationColorPurple;
    annView.calloutOffset = CGPointMake(-5, 5);
    return annView;
}
</pre>
<p>Voila you now have a pin dropped on the map and automatically selected.  If you don&#8217;t want the title automatically displayed then change</p>
<pre name="code" class="cpp">
[annView setSelected:YES];
</pre>
<p><em>The final part demonstrates how to create a <a href="http://www.richardhyland.com/diary/2009/11/20/creating-a-mini-map-using-mapkit-on-the-iphone/">mini map</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/10/27/how-to-add-a-pin-to-embedded-map/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating a mini map using MapKit on the iPhone</title>
		<link>http://www.richardhyland.com/diary/2009/11/20/creating-a-mini-map-using-mapkit-on-the-iphone/</link>
		<comments>http://www.richardhyland.com/diary/2009/11/20/creating-a-mini-map-using-mapkit-on-the-iphone/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 13:03:38 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=571</guid>
		<description><![CDATA[So as promised here is the final part of my MapKit tips and tricks using the iPhone SDK. Sorry it&#8217;s a little later than I intended as I wanted my version of the feature live in the AppStore before I published the article. So we&#8217;ve seen before how to create a simple map, well now [...]]]></description>
			<content:encoded><![CDATA[<p>So as promised here is the final part of my MapKit tips and tricks using the iPhone SDK.</p>
<p>Sorry it&#8217;s a little later than I intended as I wanted my version of the feature live in the AppStore before I published the article.</p>
<p>So we&#8217;ve seen before how to create a simple map, well now let&#8217;s see how to create a really small thumbnail sized version like this <em>(sorry there is no anti-aliasing, the iPhone simulator doesn&#8217;t support it on MapKit, works fine on the actual device though!)</em></p>
<p><img class="aligncenter size-full wp-image-573" title="smallmap" src="http://www.richardhyland.com/diary/wp-content/uploads/2009/11/smallmap.jpg" alt="smallmap" width="111" height="58" /></p>
<p>In my version, I take this code and add it to a much larger view controller like this</p>
<p><img class="aligncenter size-full wp-image-572" title="bigmap" src="http://www.richardhyland.com/diary/wp-content/uploads/2009/11/bigmap.jpg" alt="bigmap" width="322" height="477" /></p>
<p><em>A bit of shameless plugging: this comes from <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=323248061&#038;mt=8&#038;s=143441">Tweetings</a> for the iPhone</em></p>
<p>I won&#8217;t cover anything more to this other than getting the map to a state where you can add it to any view of yours using the [object addSubview:mapView] call.</p>
<p><strong>Generating the map</strong></p>
<p>This is the same as generating a large map, that we&#8217;ve covered before, except the frame will be of a different size, however the most important factor here is we are going to scale the map</p>
<pre class="cpp" name="code">
float scaleBy = 0.80;
MKMapView *mapView = [[[MKMapView alloc] initWithFrame:CGRectMake(-5, 0, 100/ scaleBy, 50/scaleBy)] autorelease];
mapView.delegate=self;
mapView.layer.cornerRadius = 10.0; // Make the corners rounded
mapView.opaque = NO; // If you are using in a UITableView never set to YES!
mapView.scrollEnabled = NO; // Don't allow user interaction
mapView.zoomEnabled = NO;
mapView.layer.borderColor = [UIColor colorWithWhite:0.0f alpha:0.5f].CGColor;
mapView.layer.borderWidth = 1.0f/ scaleBy;
mapView.layer.transform = CATransform3DMakeScale(scaleBy, scaleBy, 1.0);
</pre>
<p>At this point you can actually now add it to your view and set any other properties in the same way as you would normally, job done&#8230;. yes it really is that simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/11/20/creating-a-mini-map-using-mapkit-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

