<?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 &#187; Computers &amp; Internet</title>
	<atom:link href="http://www.richardhyland.com/diary/category/computers-internet/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>Fri, 16 Jul 2010 13:32:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='www.richardhyland.com' port='80' path='/diary/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<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 3.5 [...]]]></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>
<h2>Images</h2>
<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>
<h2>Default splash images</h2>
<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>
<h2>Springboard App Icon</h2>
<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>
<h2>Conclusion</h2>
<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>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 lot [...]]]></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 expense to [...]]]></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>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 let&#8217;s see [...]]]></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>
		<item>
		<title>My take on Chrome OS</title>
		<link>http://www.richardhyland.com/diary/2009/11/20/my-take-on-chrome-os/</link>
		<comments>http://www.richardhyland.com/diary/2009/11/20/my-take-on-chrome-os/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:47:24 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Computers & Internet]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=568</guid>
		<description><![CDATA[So Google have unveiled Chrome OS&#8230; which in actual fact is just a web browser where all you can do is interact with web apps.  This isn&#8217;t a review, in fact if you want that go to Engadget
It&#8217;s even less than a thin client of old (read: Citrix). When did we suddenly decide that [...]]]></description>
			<content:encoded><![CDATA[<p>So Google have unveiled Chrome OS&#8230; which in actual fact is just a web browser where all you can do is interact with web apps.  This isn&#8217;t a review, in fact if you want that go to <a href="http://www.engadget.com/2009/11/19/googles-chrome-os-revealed/" target="_blank">Engadget</a></p>
<p>It&#8217;s even less than a thin client of old (read: Citrix). When did we suddenly decide that thin clients were a good idea again?</p>
<p>I&#8217;ll just put one single thought and it was said by Marc Andreessen in 1995</p>
<blockquote><p>&#8220;[Netscape will soon reduce Windows to] a poorly debugged set of device drivers.&#8221;</p></blockquote>
<p>Yeah that went well didn&#8217;t it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/11/20/my-take-on-chrome-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeAgent: online accounting application</title>
		<link>http://www.richardhyland.com/diary/2009/11/04/freeagent-online-accounting-application/</link>
		<comments>http://www.richardhyland.com/diary/2009/11/04/freeagent-online-accounting-application/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 18:30:13 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Computers & Internet]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=559</guid>
		<description><![CDATA[I like many people dread the 31st of January in the UK as it&#8217;s time to make sure I&#8217;ve not only submitted my tax return to HMRC but I&#8217;ve also paid any tax I owe.
It&#8217;s a horrible task but it&#8217;s just been made a whole lot easier using a great online application called FreeAgent.
For me [...]]]></description>
			<content:encoded><![CDATA[<p>I like many people dread the 31st of January in the UK as it&#8217;s time to make sure I&#8217;ve not only submitted my tax return to HMRC but I&#8217;ve also paid any tax I owe.</p>
<p>It&#8217;s a horrible task but it&#8217;s just been made a whole lot easier using a great online application called <a href="http://www.freeagentcentral.com?referrer=33kom1a7" target="_blank">FreeAgent</a>.</p>
<p>For me it allows me to keep any invoices in check, remittance notes and all my expenses (including uploading a scanned PDF copy of the actual receipt).</p>
<p>Then come Self-Assessment time I can see my expenses all in one place and how much I can be expected to pay for my taxes.  It&#8217;s so easy it&#8217;s a dream, I can&#8217;t recommend it highly enough!</p>
<p>What&#8217;s more if you click through for a 30 day free trial from this link now, you&#8217;ll get a 10% discount!</p>
<p><a title="FreeAgent: money management and accounting for freelancers, contractors and consultants" href="http://www.freeagentcentral.com/?referrer=33kom1a7"><img src="http://www.freeagentcentral.com/images/i-heart-fa.jpg" alt="FreeAgent sign-up" width="205" height="85" border="0" style="border:0px;" /></a></p>
<p>Now I&#8217;ll say upfront I don&#8217;t have much experience with this sort of application and I&#8217;ve never used Sage, etc . When you sign up for FreeAgent you get your own URL (http://yourcompany.freeagentcentral.com) and login, but this has one of the easiest to use interfaces I&#8217;ve seen for something that is a very complex and powerful web application.</p>
<p>In a matter of an hour I had all my yearly expenses in the system and added my income and even my PAYE P60 for my Self-Assessment.</p>
<p>I&#8217;ve only touched a handful of the features on offer, it also allows bank account integration which I&#8217;m sure is incredibly powerful, I&#8217;ve just not used it yet!</p>
<p><strong>The Features</strong> (shamelessly copied from the FreeAgent website)<br />
	<img class="alignright size-full wp-image-560" title="FreeAgent Features" src="http://www.richardhyland.com/diary/wp-content/uploads/2009/11/FAfeatures.png" alt="FreeAgent Features" width="258" height="284" border="0" style="border:0px;" /></p>
<ul>
<li><strong>Manage Projects &amp; Time<br />
</strong>Manage your projects and contacts, track the time you spend and create flexible timesheet reports.</li>
<li><strong>Simple, Powerful Invoicing<br />
</strong>Create great looking invoices with no fuss. Email them to the client and easily track through to payment.</li>
<li><strong>Keep track of Expenses<br />
</strong>Keep tabs on your business and out-of-pocket expenses and quickly rebill to clients.</li>
<li><strong>Superior Online Banking<br />
</strong>Online banking that’s better than the banks. Compare accounts and track balances.</li>
<li><strong>Realtime Accounts<br />
</strong>No complicated procedures, FreeAgent simply works out your accounts as you run your business.</li>
<li><strong>Unrivalled Tax Features</strong><br />
Our unique Tax timeline lets you see important UK income, VAT and corporate tax dates and how much is due.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/11/04/freeagent-online-accounting-application/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 &#60;Foundation/Foundation.h&#62;
#import &#60;MapKit/MapKit.h&#62;

@interface PlaceMark : [...]]]></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>How to embed a map on the iPhone</title>
		<link>http://www.richardhyland.com/diary/2009/10/17/how-to-embed-a-map-on-the-iphone/</link>
		<comments>http://www.richardhyland.com/diary/2009/10/17/how-to-embed-a-map-on-the-iphone/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 19:05:46 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=548</guid>
		<description><![CDATA[In the first of a few posts I intend to make I&#8217;ll demonstrate some examples using the iPhone SDK.
This example will demonstrate how to embed a map, using the MKMapKit framework inside a UIView using the iPhone SDK.  Note you must be using iPhone OS 3.0 or higher for this to work.  The [...]]]></description>
			<content:encoded><![CDATA[<p>In the first of a few posts I intend to make I&#8217;ll demonstrate some examples using the iPhone SDK.</p>
<p>This example will demonstrate how to embed a map, using the MKMapKit framework inside a UIView using the iPhone SDK.  Note you must be using iPhone OS 3.0 or higher for this to work.  The ultimate aim is to get a UIView that looks similar to this.</p>
<p>For this example I will assume you are already familiar with navigation and UIViews in the SDK (and so I won&#8217;t cover how to get the navigation bar at the top of this screenshot)</p>
<p><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>Add the framework</h2>
<p>First up you must go to the Frameworks folder of your XCode project and add the existing framework of MKMapKit.</p>
<p>Then inside the header file for your view add</p>
<pre class="cpp" name="code">
#import &lt;MapKit/MapKit.h&gt;
</pre>
<h2>Adding MapKit references to the header</h2>
<p>Now we must add the mapKit instance to the header as well as the MapKit delegate</p>
<pre class="cpp" name="code">
@interface MapKitViewController : UIViewController &lt;MKMapViewDelegate&gt; {
	MKMapView *mapView;
}
-(void)displayMap;
</pre>
<h2>Initialize the Map</h2>
<pre class="cpp" name="code">
- (void)viewDidLoad {
	mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
	mapView.delegate=self;

	[self.view addSubview:mapView];
	[NSThread detachNewThreadSelector:@selector(displayMap) toTarget:self withObject:nil];
}

-(void)displayMap {
	MKCoordinateRegion region;
	MKCoordinateSpan span;
	span.latitudeDelta=0.2;
	span.longitudeDelta=0.2;

	CLLocationCoordinate2D location;
	location.latitude = -35;
	location.longitude = 146.2381;
	region.span=span;
	region.center=location;

	[mapView setRegion:region animated:TRUE];
	[mapView regionThatFits:region];
}

- (void)dealloc {
	[mapView release];
        [super dealloc];
}
</pre>
<p>This will give us a map fitting the screen with the region and zoom level set to best fit the coordinates given.  Note that I have physically defined the coordinates here in this example, you can use something like the Google GeoCode API to convert addresses, etc to coordinates.  I won&#8217;t cover that here.</p>
<h2>Changing the map type</h2>
<p>In the example above is a tool bar allowing you to switch map types</p>
<p>Let&#8217;s define the toolbar in the header file inside the @implementation</p>
<pre class="cpp" name="code">
UISegmentedControl *buttonBarSegmentedControl;
</pre>
<p>Now inside the main code inside ViewDidLoad we add</p>
<pre class="cpp" name="code">
buttonBarSegmentedControl = [[UISegmentedControl alloc] initWithItems:
	[NSArray arrayWithObjects:@"Standard", @"Satellite", @"Hybrid", nil]];
	[buttonBarSegmentedControl setFrame:CGRectMake(30, 10, 280-30, 30)];
        buttonBarSegmentedControl.selectedSegmentIndex = 0.0;	// start by showing the normal picker
	[buttonBarSegmentedControl addTarget:self action:@selector(toggleToolBarChange:) forControlEvents:UIControlEventValueChanged];
	buttonBarSegmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
	buttonBarSegmentedControl.backgroundColor = [UIColor clearColor];
	[buttonBarSegmentedControl setAlpha:0.8];

	[self.view addSubview:buttonBarSegmentedControl];
</pre>
<p>Then we must add the function for what happens when we tap on the tool bar</p>
<pre class="cpp" name="code">
- (void)toggleToolBarChange:(id)sender
{
	UISegmentedControl *segControl = sender;

	switch (segControl.selectedSegmentIndex)
	{
		case 0:	// Map
		{
			[mapView setMapType:MKMapTypeStandard];
			break;
		}
		case 1: // Satellite
		{
			[mapView setMapType:MKMapTypeSatellite];
			break;
		}
		case 2: // Hybrid
		{
			[mapView setMapType:MKMapTypeHybrid];
			break;
		}
	}
}
</pre>
<p>In the <a href="http://www.richardhyland.com/diary/2009/10/27/how-to-add-a-pin-to-embedded-map/">next example</a>, I&#8217;ll cover how to add the annotations (the small pins) to the map</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/10/17/how-to-embed-a-map-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The nasty side of Twitter</title>
		<link>http://www.richardhyland.com/diary/2009/10/04/the-nasty-side-of-twitter/</link>
		<comments>http://www.richardhyland.com/diary/2009/10/04/the-nasty-side-of-twitter/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 16:22:04 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Computers & Internet]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=543</guid>
		<description><![CDATA[For most Twitter is a fantastic communication tool.  The way in which any one can follow anyone else and follow their stream of Tweets is exactly what makes Twitter the success that it is.  Unfortunately this level of openness is not without it&#8217;s pit falls.
I&#8217;ve been following @KirstieMAllsopp for a while now, in case you [...]]]></description>
			<content:encoded><![CDATA[<p>For most Twitter is a fantastic communication tool.  The way in which any one can follow anyone else and follow their stream of Tweets is exactly what makes Twitter the success that it is.  Unfortunately this level of openness is not without it&#8217;s pit falls.</p>
<p>I&#8217;ve been following @<a href="http://twitter.com/KirstieMAllsopp">KirstieMAllsopp</a> for a while now, in case you don&#8217;t know who <a href="http://en.wikipedia.org/wiki/Kirstie_Allsopp">Kirstie</a> is she is British TV presenter and property guru.  After reading a few of her messages, it became clear that Kirstie and other famous celebrity tweeters are the victims of an Internet bullying campaign.</p>
<p>The bullies themselves don&#8217;t see that their words are bullying but by the very definition of what cyber bullying is, they are.  Now I won&#8217;t link to any of their accounts here because it&#8217;ll just give them some sick perversion and draw attention to them directly.</p>
<p>However Kirstie was unable to block them at the time from the mobile website of Twitter and had to wait until she could, consequently a number of people replied to Kirstie offering kind words of support only to have the bullies turn on them and flood their @mentions feed with abuse.</p>
<p>I too have had these messages sent to me and I&#8217;ll post a few examples now (self censored so as not to offend)</p>
<blockquote><p>@<a style="text-decoration: none; color: #2276bb; padding: 0px; margin: 0px;" href="http://twitter.com/KirstieMAllsopp">KirstieMAllsopp</a> f***** block me will ya ya fat do goody scrubber. Yer programme is s*** and ur fat nd ugly lol</p>
<p>@<a style="text-decoration: none; color: #2276bb; padding: 0px; margin: 0px;" href="http://twitter.com/twbrit">twbrit</a> u think u r so f****** clever e mailing that fat bird off telly well keep ur f***** thoughts to yerself bout my mates or Ill ave u</p>
<p>@<a style="text-decoration: none; color: #2276bb; padding: 0px; margin: 0px;" href="http://twitter.com/richardhyland">richardhyland</a> if u bad mouth @****** or @********* gin u 4 eyed gimp Ill f****** kick ur chav arse this will be ur only warning c***</p></blockquote>
<p>And that was just three of around 30 tweets from one of these users in around 30 minutes!</p>
<p>Others included</p>
<blockquote><p>@<a style="text-decoration: none; color: #143d69; padding: 0px; margin: 0px;" href="http://twitter.com/KirstieMAllsopp">KirstieMAllsopp</a> fat s*** (via @******) this one is trying to ban you all @****** She is a seriously obese dull bitch</p>
<p>@<a style="text-decoration: none; color: #2fc2ef; padding: 0px; margin: 0px;" href="http://twitter.com/KirstieMAllsopp">KirstieMAllsopp</a> kirstie, where on your body is the perfect location for me to s***? your chest? your hair? your eyes?</p></blockquote>
<p>I think any sane person will agree it&#8217;s pretty foul stuff and whilst most adults swear at some point, there is simply no excuse or point in their sad little tweets apart from upsetting normal people using a great service like Twitter.</p>
<p>Twitter do provide a method of <a href="http://twitter.zendesk.com/requests">feedback </a>to harassment, yet a week after this came to my attention, every single one of the accounts is still active.  Is Twitter unable or unwilling to do something about it?</p>
<p>Celebrities have often had to put up with a lot because of their fame, paparazzi, untrue stories, but no one deserves to be abused or bullied in this way whether it be online or in person.</p>
<p style="margin-top: 18px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;"><strong style="padding: 0px; margin: 0px;">Update: </strong>Since I posted this, one of the accounts has now gone, I don&#8217;t think it was suspended but the user either deleted it or changed his screen name</p>
<p style="margin-top: 18px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; padding: 0px;"><strong style="padding: 0px; margin: 0px;">Update II</strong>: Two down now&#8230; hopefully more to come</p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/10/04/the-nasty-side-of-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple Store Love Song</title>
		<link>http://www.richardhyland.com/diary/2009/09/29/apple-store-love-song/</link>
		<comments>http://www.richardhyland.com/diary/2009/09/29/apple-store-love-song/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:13:47 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Computers & Internet]]></category>

		<guid isPermaLink="false">http://www.richardhyland.com/diary/?p=541</guid>
		<description><![CDATA[Simply genius 

]]></description>
			<content:encoded><![CDATA[<p>Simply genius </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Q7C8tJos0zE&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Q7C8tJos0zE&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.richardhyland.com/diary/2009/09/29/apple-store-love-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
