<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>MK Blog</title>
	
	<link>http://blog.mugunthkumar.com</link>
	<description>iPhone, iPad, Windows Development and Usability Guidelines</description>
	<lastBuildDate>Tue, 07 Sep 2010 16:28:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MugunthKumar" /><feedburner:info uri="mugunthkumar" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license><feedburner:emailServiceId>MugunthKumar</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>iPhone Tutorial: Display WebPages within your App using this drop dead Simple XIB file</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/JDHhstByrxI/</link>
		<comments>http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 16:28:48 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=858</guid>
		<description><![CDATA[How many lines of code do you have to write for displaying a webpage &#8216;in-app&#8221;. 3 methinks. Wouldn&#8217;t be great if there is a built in class for presenting a webpage using &#8220;presentModalViewController&#8221;? Meet MKWebViewController. Step 1: Drop the attached three files into your project and write the following three lines on your action callback [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/' rel='bookmark' title='Permanent Link: iPhone Tutorial: How to send In-App SMS'>iPhone Tutorial: How to send In-App SMS</a> <small>Officially, iPhone OS 4 is out of NDA and I...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How many lines of code do you have to write for displaying a webpage &#8216;in-app&#8221;.<br />
3 methinks.</p>
<p>Wouldn&#8217;t be great if there is a built in class for presenting a webpage using &#8220;presentModalViewController&#8221;? Meet MKWebViewController. </p>
<h2>Step 1:</h2>
<p>Drop the attached three files into your project and write the following three lines on your action callback (buttonDidTap) or equivalent methods</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">MKWebViewController <span style="color: #002200;">*</span>controller <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MKWebViewController alloc<span style="color: #002200;">&#93;</span> initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;MKWebViewController&quot;</span> bundle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
controller.url <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://blog.mugunthkumar.com&quot;</span>;
<span style="color: #002200;">&#91;</span>self presentModalViewController<span style="color: #002200;">:</span>controller animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<h2>Step 2:</h2>
<p>Nah, no step 2.</p>
<p>That&#8217;s it. On landscape mode, the controller even rotates and hides the toolbar. On portrait mode it brings back the toolbar and provides you a close button. The controller automatically handles any errors, and displays appropriate error messages, close the window when the user taps on the &#8220;Dismiss&#8221; button on the error message. What more, the controller can also display any iOS supported file format that includes, PDF, Office, iWork documents.</p>
<p>Give it a try, and do let me know your feedback.</p>
<h2>Source Code</h2>
<p><a href="http://blog.mugunthkumar.com/wp-content/uploads/MKWebViewController.zip">MKWebViewController.zip</a><br />
&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_858_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/858?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_858_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=858&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fiphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XI%5B..%5D+-+http://mk.sg/7k&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/&amp;title=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XIB+file&amp;srcUrl=http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/&amp;srcTitle=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XIB+file&amp;snippet=How%20many%20lines%20of%20code%20do%20you%20have%20to%20write%20for%20displaying%20a%20webpage%20%27in-app%22.%0D%0A3%20methinks.%0D%0A%0D%0AWouldn%27t%20be%20great%20if%20there%20is%20a%20built%20in%20class%20for%20presenting%20a%20webpage%20using%20%22presentModalViewController%22%3F%20Meet%20MKWebViewController.%20%0D%0AStep%201%3A%0D%0ADrop%20the%20attached%20three%20files%20into%20your%20project%20and%20write%20th" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/&amp;title=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XIB+file" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/&amp;t=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XIB+file" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XIB+file&amp;link=http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XIB+file&amp;body=Link: http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A How%20many%20lines%20of%20code%20do%20you%20have%20to%20write%20for%20displaying%20a%20webpage%20%27in-app%22.%0D%0A3%20methinks.%0D%0A%0D%0AWouldn%27t%20be%20great%20if%20there%20is%20a%20built%20in%20class%20for%20presenting%20a%20webpage%20using%20%22presentModalViewController%22%3F%20Meet%20MKWebViewController.%20%0D%0AStep%201%3A%0D%0ADrop%20the%20attached%20three%20files%20into%20your%20project%20and%20write%20th" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/&amp;title=iPhone+Tutorial%3A+Display+WebPages+within+your+App+using+this+drop+dead+Simple+XIB+file" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/' rel='bookmark' title='Permanent Link: iPhone Tutorial: How to send In-App SMS'>iPhone Tutorial: How to send In-App SMS</a> <small>Officially, iPhone OS 4 is out of NDA and I...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/qc6zwnkYDCqvj3kzz0hNi8uzEYQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/qc6zwnkYDCqvj3kzz0hNi8uzEYQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qc6zwnkYDCqvj3kzz0hNi8uzEYQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/qc6zwnkYDCqvj3kzz0hNi8uzEYQ/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/iphone-tutorial-display-webpages-within-your-app-using-this-drop-dead-simple-xib-file/</feedburner:origLink></item>
		<item>
		<title>iPhone Tutorial: Better way to check capabilities of iOS devices</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/hJBVhow22h8/</link>
		<comments>http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 02:04:56 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone dev]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=844</guid>
		<description><![CDATA[The iPhone OS started off with a single device, the original iPhone, ala, iPhone 1,1. In the last three years, Apple has been innovating hard and introduced multiple devices running the same operating system with different capabilities. For example, the original iPod touch, iPod 1,1 wasn&#8217;t able to record audio input, and till date iPod [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/' rel='bookmark' title='Permanent Link: iPhone Tutorial: How to send In-App SMS'>iPhone Tutorial: How to send In-App SMS</a> <small>Officially, iPhone OS 4 is out of NDA and I...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Scheduling Local Notifications using a Singleton class'>iPhone Tutorial: Scheduling Local Notifications using a Singleton class</a> <small>In iOS 4, Apple introduced a new way to send...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free'>iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free</a> <small>In-App purchases is a great way for developers to upsell...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The iPhone OS started off with a single device, the original iPhone, ala, iPhone 1,1. In the last three years, Apple has been innovating hard and introduced multiple devices running the same operating system with different capabilities. For example, the original iPod touch, iPod 1,1 wasn&#8217;t able to record audio input, and till date iPod Touch cannot vibrate as a result of an alert. There are many such subtle differences between different iOS devices and it&#8217;s the developer&#8217;s effort to make sure that the code runs properly on all devices.</p>
<h2>Problems using the device model</h2>
<p>Most developers have resorted to reading the hw.machine parameter to check if the device is an iPhone or iPod touch. Another lousy way is to read the [UIDevice currentDevice].model. The problem with these methods are that, you are essentially comparing the device name with a hard-coded value. As such, code like</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIDevice currentDevice<span style="color: #002200;">&#93;</span>.model isEqualToString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;iPhone&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
UIAlertView <span style="color: #002200;">*</span>alertView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIAlertView alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Error&quot;</span> 
message<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Microphone not present&quot;</span> 
delegate<span style="color: #002200;">:</span>self 
cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Dismiss&quot;</span> 
otherButtonTitles<span style="color: #002200;">:</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>alertView show<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>alertView release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>will fail miserably on iPad and on iPod Touch if an external microphone is connected. On similar lines, you cannot assert something like,</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIDevice currentDevice<span style="color: #002200;">&#93;</span>.model isEqualToString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;iPhone 4,1&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
<span style="color: #11740a; font-style: italic;">// lets start a video conferencing session here.</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Today, this code will work perfectly, but with next release of the iPod Touch or the iPad that might probably have a front facing camera, your app (or the video conferencing feature) will no longer work on the new device though it&#8217;s (might be) capable of video conferencing.</p>
<p>There are Apple defined ways to check the hardware capabilities rather than assuming features based on the model string. In this tutorial, we will walk you through the various pitfalls that any iOS developer may encounter and provide solutions on how to combat them. Also provided is a complete source code and an elegant, drop dead simple to use device capabilities helper class.</p>
<h2>Gonna Vibrate the device to alert the user? Read this first</h2>
<p>Apple has documented two functions that would vibrate the iPhone. But vibration hardware is present only on iPhones (at least currently). So how will you alert your user who uses the app on iPad or iPod touches? Clearly, checking the model is not the way to go. Apple has provided an elegant solution to this. There are two seemingly similar functions that take a parameter kSystemSoundID_Vibrate</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #2400d9;">1</span><span style="color: #002200;">&#41;</span> AudioServicesPlayAlertSound<span style="color: #002200;">&#40;</span>kSystemSoundID_Vibrate<span style="color: #002200;">&#41;</span>;
<span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span> AudioServicesPlaySystemSound<span style="color: #002200;">&#40;</span>kSystemSoundID_Vibrate<span style="color: #002200;">&#41;</span>;</pre></div></div>

<p>Both the functions vibrate the iPhone. But when you use the first function on devices that don&#8217;t support vibration, it plays a beep sound. The second function on the other hand does nothing  on unsupported devices. So if you are going to vibrate the device continuously, as a alert, common sense says, use function 2.</p>
<h2>Phone Call Capable?</h2>
<p>Checking if a device is capable of making a phone call is as easy as making a function call to check if the device can handle URLs of type &#8220;tel://&#8221;</p>
<p>Again, in future if there is a 7&#8243; iProduct that sits somewhere in between the iPad and iPhone and has call capabilities, this method will work on that device as well.</p>
<p>As a side note on <a href="http://blog.mugunthkumar.com/tag/usability/">usability</a>, avoid showing an error like,</p>
<blockquote><p>Sorry, you are not running on iPhone, This feature requires an iPhone.</p></blockquote>
<p>if your app uses this feature to detect a phone from an iPod. In most cases, you show a telphone number and have a call button to make a phone call. On iPod Touch or other devices, just hide that button. That gives a better user experience than a error message. The user already knows that he doesn&#8217;t have an iPhone and his device cannot make a phone call. You don&#8217;t have to repeat that.</p>
<h2>Email capability</h2>
<p>Email is a bit tricky thing. You cannot always assume the all devices will support in-app email. If you read my previous <a href="http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/">tutorial on in-app email</a>, I would have mandated to check the email capability using</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span>MFMailComposeViewController canSendMail<span style="color: #002200;">&#93;</span></pre></div></div>

<p>This class is available from iOS 3.0. You might think that, because I always set the iPhone OS Deployment target to 3.0, I don&#8217;t have to check this and can directly present the modal email sheet.  But the code will crash when the user has no email configuration setup in the Mail app. As such, you should always check for this capability before you show the in-app email sheet.</p>
<h2>SMS capability</h2>
<p>For SMS support, you can either use [MFMessageComposeViewController canSendText] or better check if the device can handle URLs of type &#8220;sms://&#8221;</p>
<p>The reason I would suggest using the latter is, MFMessageComposeViewController isn&#8217;t available on iPhone OS 3.2 and below. You app might crash if you try to send a non-existant message to a non-existant class.</p>
<h2>Camera/Flash/Video support</h2>
<p>Most of the camera related availability support is exposed through the UIImagePickerController. The UIImagePickerController has class methods that can be used to check if there is a camera hardware present in the device. Do note that, it&#8217;s important to check even for the availability of the Photo Library before you ask the user to pick photos. For example, if the user&#8217;s iPhone is new and he doesn&#8217;t have any photos in his Photo Library, it&#8217;s better to show an error rather than crash the application. As such, the method below returns NO when there is no photos in the user&#8217;s library.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span>UIImagePickerController isSourceTypeAvailable<span style="color: #002200;">:</span>UIImagePickerControllerSourceTypePhotoLibrary<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>A bit tricker thing is detection of Video Camera. You can detect the presence of a video camera in a iOS device using the following method.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span> isVideoCameraAvailable
<span style="color: #002200;">&#123;</span>
	UIImagePickerController <span style="color: #002200;">*</span>picker <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImagePickerController alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>sourceTypes <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImagePickerController availableMediaTypesForSourceType<span style="color: #002200;">:</span>picker.sourceType<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>picker release<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span><span style="color: #002200;">&#91;</span>sourceTypes containsObject<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>kUTTypeMovie <span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#123;</span>
&nbsp;
		<span style="color: #a61390;">return</span> <span style="color: #a61390;">NO</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #a61390;">return</span> <span style="color: #a61390;">YES</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2>Gyroscope support</h2>
<p>With iPhone 4, Apple added yet another hardware to the iPhone, namely the Gyroscope. Using Gyroscope. The Gyroscope related functions are grouped together under the CoreMotion framework. The CMMotionManager has a property called gyroAvailable to check if the device has gyroscope. Good news here is that, even if you make calls to CMMotionManager related to Gyroscope, the SDK converts them no-op on unsupported devices.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span> isGyroscopeAvailable
<span style="color: #002200;">&#123;</span>
<span style="color: #6e371a;">#ifdef __IPHONE_4_0</span>
	CMMotionManager <span style="color: #002200;">*</span>motionManager <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CMMotionManager alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">BOOL</span> gyroAvailable <span style="color: #002200;">=</span> motionManager.gyroAvailable;
	<span style="color: #002200;">&#91;</span>motionManager release<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> gyroAvailable;
<span style="color: #6e371a;">#else</span>
	<span style="color: #a61390;">return</span> <span style="color: #a61390;">NO</span>;
<span style="color: #6e371a;">#endif</span>
&nbsp;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2>Retina Display?</h2>
<p>Use the [UIScreen mainScreen].scale to check if the display is retina capable. The scale property isn&#8217;t available on all SDKs. Use respondsToSelector methods for checking the availability</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span> isRetinaDisplay
<span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">int</span> scale <span style="color: #002200;">=</span> <span style="color: #2400d9;">1.0</span>;
	UIScreen <span style="color: #002200;">*</span>screen <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIScreen mainScreen<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>screen respondsToSelector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>scale<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
		scale <span style="color: #002200;">=</span> screen.scale;
&nbsp;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>scale <span style="color: #002200;">==</span> 2.0f<span style="color: #002200;">&#41;</span> <span style="color: #a61390;">return</span> <span style="color: #a61390;">YES</span>;
	<span style="color: #a61390;">else</span> <span style="color: #a61390;">return</span> <span style="color: #a61390;">NO</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2>Multitasking support</h2>
<p>Not all devices support multitasking even on iOS 4. The iPhone 3G, and the iPod touch 2nd generation can be upgraded to iOS 4, but still will not get any of the multitasking or fast app switching benefits. I&#8217;m just re-writing Apple&#8217;s own code here</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span> isMultitaskingCapable
<span style="color: #002200;">&#123;</span>
	UIDevice<span style="color: #002200;">*</span> device <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIDevice currentDevice<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">BOOL</span> backgroundSupported <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>device respondsToSelector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>isMultitaskingSupported<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
		backgroundSupported <span style="color: #002200;">=</span> device.multitaskingSupported;
&nbsp;
	<span style="color: #a61390;">return</span> backgroundSupported;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2>Source Code</h2>
<p>To make life easier, I&#8217;ve put together a sample application and a helper class that demonstrates most of these capabilities. You can download it from here or go to <a href="http://github.com/MugunthKumar/DeviceHelper">github</a>. Again, it&#8217;s a singleton class based on my<a href="http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template"> previous xcode singleton template</a></p>
<p>MKDeviceHelper.zip</p>
<h2>Using this Class</h2>
<p>Just drag the two files MKDeviceHelper.h and it&#8217;s counterpart. Add the frameworks, AVFoundation, MessageUI, AudioToolbox, CoreLocation, MobileCoreServices and CoreMotion frameworks. Build your app and you are good to go. If you can&#8217;t find any of the XCode. The current version works fine on XCode 3.2.3</p>
<p>Note that these frameworks are dynamically linked. They will in no way bloat your app.</p>
<h2>Licensing</h2>
<p>My only request is don&#8217;t pass of this code as your own. Fork it or do whatever you want, commercial/non-commercial but retain a reference to this blog post in the code and don&#8217;t remove the URL in the source code files.</p>
<p>Hope you find this helpful</p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_844_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/844?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_844_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=844&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fiphone-tutorial-better-way-to-check-capabilities-of-ios-devices%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices+-+http://mk.sg/7g&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/&amp;title=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices&amp;srcUrl=http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/&amp;srcTitle=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices&amp;snippet=The%20iPhone%20OS%20started%20off%20with%20a%20single%20device%2C%20the%20original%20iPhone%2C%20ala%2C%20iPhone%201%2C1.%20In%20the%20last%20three%20years%2C%20Apple%20has%20been%20innovating%20hard%20and%20introduced%20multiple%20devices%20running%20the%20same%20operating%20system%20with%20different%20capabilities.%20For%20example%2C%20the%20original%20iPod%20touch%2C%20iPod%201%2C1%20wasn%27t%20able%20to%20r" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/&amp;title=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/&amp;t=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices&amp;link=http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices&amp;body=Link: http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A The%20iPhone%20OS%20started%20off%20with%20a%20single%20device%2C%20the%20original%20iPhone%2C%20ala%2C%20iPhone%201%2C1.%20In%20the%20last%20three%20years%2C%20Apple%20has%20been%20innovating%20hard%20and%20introduced%20multiple%20devices%20running%20the%20same%20operating%20system%20with%20different%20capabilities.%20For%20example%2C%20the%20original%20iPod%20touch%2C%20iPod%201%2C1%20wasn%27t%20able%20to%20r" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/&amp;title=iPhone+Tutorial%3A+Better+way+to+check+capabilities+of+iOS+devices" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/' rel='bookmark' title='Permanent Link: iPhone Tutorial: How to send In-App SMS'>iPhone Tutorial: How to send In-App SMS</a> <small>Officially, iPhone OS 4 is out of NDA and I...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Scheduling Local Notifications using a Singleton class'>iPhone Tutorial: Scheduling Local Notifications using a Singleton class</a> <small>In iOS 4, Apple introduced a new way to send...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free'>iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free</a> <small>In-App purchases is a great way for developers to upsell...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/xoHdjsgQpgKOEONgJWN4SuT5VsE/0/da"><img src="http://feedads.g.doubleclick.net/~a/xoHdjsgQpgKOEONgJWN4SuT5VsE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xoHdjsgQpgKOEONgJWN4SuT5VsE/1/da"><img src="http://feedads.g.doubleclick.net/~a/xoHdjsgQpgKOEONgJWN4SuT5VsE/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/</feedburner:origLink></item>
		<item>
		<title>iPhone Tutorial: Scheduling Local Notifications using a Singleton class</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/3r2UE95qHlM/</link>
		<comments>http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 08:28:39 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone dev]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=833</guid>
		<description><![CDATA[In iOS 4, Apple introduced a new way to send &#8220;push notifications&#8221; to your app without having a dedicated server and associated server side coding. The technique is called as scheduling local notifications. While this tutorial is about how to schedule local notifications, I would also explain how a powerful abstraction concept, Singleton design pattern [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/' rel='bookmark' title='Permanent Link: XCode Tip: Objective-C Singleton Class Template'>XCode Tip: Objective-C Singleton Class Template</a> <small>I have a habit of creating Singleton pattern classes for...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Better way to check capabilities of iOS devices'>iPhone Tutorial: Better way to check capabilities of iOS devices</a> <small>The iPhone OS started off with a single device, the...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/' rel='bookmark' title='Permanent Link: iPhone Tutorial: How to send In-App SMS'>iPhone Tutorial: How to send In-App SMS</a> <small>Officially, iPhone OS 4 is out of NDA and I...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In iOS 4, Apple introduced a new way to send &#8220;push notifications&#8221; to your app without having a dedicated server and associated server side coding. The technique is called as <a href="http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html">scheduling local notifications</a>. While this tutorial is about how to schedule local notifications, I would also explain how a powerful abstraction concept, Singleton design pattern could make this easier when adding local notification support to your app.</p>
<p>If you were following my blog, you might have already read about the <a href="http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template">singleton xcode template</a> I wrote about previously. If not, go ahead and download the Singleton class template. Install it into your xcode installation folder (which is normally /Developer). Come back here.</p>
<p>Let&#8217;s get started.</p>
<h2>Step 1:</h2>
<p>Create a view based application. (Or any application type you prefer)</p>
<h2>Step 2:</h2>
<p>Add a Singleton class using my template and call it, say, MKLocalNotificationsScheduler</p>
<h2>Step 3:</h2>
<p>Within the sharedInstance static method (which is the constructor), add the following lines of code</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// iOS 4 compatibility check</span>
<span style="color: #a61390;">Class</span> notificationClass <span style="color: #002200;">=</span> NSClassFromString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;UILocalNotification&quot;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>notificationClass <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
_instance <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">else</span>
<span style="color: #002200;">&#123;</span>
_instance <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>super allocWithZone<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
_instance.badgeCount <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>This class is the singleton method&#8217;s sole constructor. This sharedInstance is accessed your view or any other class that requires this class&#8217;s object.</p>
<p>In this class we write code for checking if UILocalNotification class is available. Remember that it&#8217;s available only on iOS 4 and above. The &#8220;constructor&#8221; intelligently allocates a instance of itself only when it runs on iOS 4. Otherwise the shared instance is always nil.</p>
<p>You should by now appreciate the power of singleton and it&#8217;s design elegance. Do note that, because we are going to channel the complete notification mechanism of the application through this single class, we can maintain the application icon&#8217;s badge count as a instance variable.</p>
<h2>Step 4:</h2>
<p>Now, lets write the real meat.</p>
<p>Scheduling a local notification is far easier compared to push notifications. Just allocate a instance of a <a href="http://developer.apple.com/iphone/library/documentation/iphone/Reference/UILocalNotification_Class/Reference/Reference.html">UILocalNotification</a> and fill in the necessary parameters and submit it to the applications&#8217; shared instance.</p>
<p>In our singleton instance, we will create a helper method that automatically creates a local notification object, fills it with default values properly and schedules it. The helper also takes care of incrementing the badgeCount, thereby maintaining its state.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> scheduleNotificationOn<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDate</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> fireDate
								text<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> alertText
								action<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> alertAction
								 sound<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> soundfileName
						   launchImage<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> launchImage
							   andInfo<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> userInfo
&nbsp;
<span style="color: #002200;">&#123;</span>
	UILocalNotification <span style="color: #002200;">*</span>localNotification <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UILocalNotification alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
    localNotification.fireDate <span style="color: #002200;">=</span> fireDate;
    localNotification.timeZone <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSTimeZone</span> defaultTimeZone<span style="color: #002200;">&#93;</span>;	
&nbsp;
    localNotification.alertBody <span style="color: #002200;">=</span> alertText;
    localNotification.alertAction <span style="color: #002200;">=</span> alertAction;	
&nbsp;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>soundfileName <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span>
	<span style="color: #002200;">&#123;</span>
		localNotification.soundName <span style="color: #002200;">=</span> UILocalNotificationDefaultSoundName;
	<span style="color: #002200;">&#125;</span>
	<span style="color: #a61390;">else</span>
	<span style="color: #002200;">&#123;</span>
		localNotification.soundName <span style="color: #002200;">=</span> soundfileName;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	localNotification.alertLaunchImage <span style="color: #002200;">=</span> launchImage;
&nbsp;
	self.badgeCount <span style="color: #002200;">++</span>;
    localNotification.applicationIconBadgeNumber <span style="color: #002200;">=</span> self.badgeCount;
    localNotification.userInfo <span style="color: #002200;">=</span> userInfo;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Schedule it with the app</span>
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> scheduleLocalNotification<span style="color: #002200;">:</span>localNotification<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>localNotification release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2>Step 5:</h2>
<p>Now, to test this, un-comment the viewDidLoad method from the view controller generated by XCode. Add the following line</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MKLocalNotificationsScheduler sharedInstance<span style="color: #002200;">&#93;</span> scheduleNotificationOn<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDate</span> dateWithTimeIntervalSinceNow<span style="color: #002200;">:</span><span style="color: #2400d9;">20</span><span style="color: #002200;">&#93;</span>
text<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Hey there&quot;</span>
action<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;View&quot;</span>
sound<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span>
launchImage<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span>
andInfo<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Note that, except the fireDate, all other parameters can be nil and the helper automatically fills in the default values. As such your calling code is just a one liner.</p>
<h2>Step 6:</h2>
<p>Now, when a local notification arrives, the operating system, notifies you through two different channels. One is the</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>application<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application didFinishLaunchingWithOptions<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>launchOptions</pre></div></div>

<p>method and the other is</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>application<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>app didReceiveLocalNotification<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UILocalNotification <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>localNotification;</pre></div></div>

<p>A better design guideline would be to pass this localNotification object to our Singleton class as that Singleton class is the one that &#8220;best knows&#8221; what to do with the notification payload.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">UILocalNotification <span style="color: #002200;">*</span>localNotification <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>launchOptions objectForKey<span style="color: #002200;">:</span>UIApplicationLaunchOptionsLocalNotificationKey<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>localNotification<span style="color: #002200;">&#41;</span> 
<span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MKLocalNotificationsScheduler sharedInstance<span style="color: #002200;">&#93;</span> handleReceivedNotification<span style="color: #002200;">:</span>localNotification<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Step 7:<br />
Write a function within our Singleton to handle the notification payload. In our case, we just NSLog the notification description and reduce the badge count. You can add your app-specific sophisticated logic here.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> handleReceivedNotification<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UILocalNotification<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> thisNotification
<span style="color: #002200;">&#123;</span>
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Received: %@&quot;</span>,<span style="color: #002200;">&#91;</span>thisNotification description<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
	<span style="color: #002200;">&#91;</span>self decreaseBadgeCountBy<span style="color: #002200;">:</span><span style="color: #2400d9;">1</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Also write other miscellaneous helper methods that handle badge count</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> clearBadgeCount
<span style="color: #002200;">&#123;</span>
	self.badgeCount <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
	<span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span>.applicationIconBadgeNumber <span style="color: #002200;">=</span> self.badgeCount;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> decreaseBadgeCountBy<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span><span style="color: #002200;">&#41;</span> count
<span style="color: #002200;">&#123;</span>
	self.badgeCount <span style="color: #002200;">-=</span> count;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>self.badgeCount &lt; <span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span> self.badgeCount <span style="color: #002200;">==</span> <span style="color: #2400d9;">0</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span>.applicationIconBadgeNumber <span style="color: #002200;">=</span> self.badgeCount;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Now run the app on simulator or device. Note that unlike, push notifications, local notifications work on simulator. Since we schedule a local notification after 20 sec, close the app by clicking the home button on the simulator (or device) and wait. You should see a alert box like this.</p>
<p><a href="http://blog.mugunthkumar.com/wp-content/uploads/iPhone-Simulator-5.png"><img src="http://blog.mugunthkumar.com/wp-content/uploads/iPhone-Simulator-5-210x300.png" alt="" title="iPhone Simulator showing local notifications" width="210" height="300" class="aligncenter size-medium wp-image-842" /></a></p>
<h2>Source Code:</h2>
<p>The complete source code is available at <a href="http://github.com/MugunthKumar/LocalNotifications">Github</a>. Feel free to tinker with the code and mainly, if you fork it, and want me to have a look, do drop me a message or leave a comment here.</p>
<p>That&#8217;s it for this tutorial. Happy coding (and designing).</p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_833_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/833?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_833_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=833&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fiphone-tutorial-scheduling-local-notifications-using-a-singleton-class%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class+-+http://mk.sg/7f&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/&amp;title=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class&amp;srcUrl=http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/&amp;srcTitle=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class&amp;snippet=In%20iOS%204%2C%20Apple%20introduced%20a%20new%20way%20to%20send%20%22push%20notifications%22%20to%20your%20app%20without%20having%20a%20dedicated%20server%20and%20associated%20server%20side%20coding.%20The%20technique%20is%20called%20as%20scheduling%20local%20notifications.%20While%20this%20tutorial%20is%20about%20how%20to%20schedule%20local%20notifications%2C%20I%20would%20also%20explain%20how%20a%20p" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/&amp;title=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/&amp;t=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class&amp;link=http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class&amp;body=Link: http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A In%20iOS%204%2C%20Apple%20introduced%20a%20new%20way%20to%20send%20%22push%20notifications%22%20to%20your%20app%20without%20having%20a%20dedicated%20server%20and%20associated%20server%20side%20coding.%20The%20technique%20is%20called%20as%20scheduling%20local%20notifications.%20While%20this%20tutorial%20is%20about%20how%20to%20schedule%20local%20notifications%2C%20I%20would%20also%20explain%20how%20a%20p" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/&amp;title=iPhone+Tutorial%3A+Scheduling+Local+Notifications+using+a+Singleton+class" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/' rel='bookmark' title='Permanent Link: XCode Tip: Objective-C Singleton Class Template'>XCode Tip: Objective-C Singleton Class Template</a> <small>I have a habit of creating Singleton pattern classes for...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Better way to check capabilities of iOS devices'>iPhone Tutorial: Better way to check capabilities of iOS devices</a> <small>The iPhone OS started off with a single device, the...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/' rel='bookmark' title='Permanent Link: iPhone Tutorial: How to send In-App SMS'>iPhone Tutorial: How to send In-App SMS</a> <small>Officially, iPhone OS 4 is out of NDA and I...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/FUTVjeUj9UMDQy50yAKUu3YKndw/0/da"><img src="http://feedads.g.doubleclick.net/~a/FUTVjeUj9UMDQy50yAKUu3YKndw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FUTVjeUj9UMDQy50yAKUu3YKndw/1/da"><img src="http://feedads.g.doubleclick.net/~a/FUTVjeUj9UMDQy50yAKUu3YKndw/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/</feedburner:origLink></item>
		<item>
		<title>XCode Tip: Objective-C Singleton Class Template</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/RiqDis59570/</link>
		<comments>http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 07:31:56 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone dev]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=825</guid>
		<description><![CDATA[I have a habit of creating Singleton pattern classes for nearly every application I write. I manage the Settings Bundle (or any app settings, thru a Singleton class), my MKStoreManager for doing in-app purchases is a Singleton class. Even in Apple&#8217;s own code you can see some Singletons like UIApplication, Reachability (from the Reachability example), [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Scheduling Local Notifications using a Singleton class'>iPhone Tutorial: Scheduling Local Notifications using a Singleton class</a> <small>In iOS 4, Apple introduced a new way to send...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/bit-ly-wrapper-objective-c-iphone/' rel='bookmark' title='Permanent Link: bit.ly wrapper for Objective-C/iPhone'>bit.ly wrapper for Objective-C/iPhone</a> <small>Continuing from my part 1, in this section, we will...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Better way to check capabilities of iOS devices'>iPhone Tutorial: Better way to check capabilities of iOS devices</a> <small>The iPhone OS started off with a single device, the...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have a habit of creating Singleton pattern classes for nearly every application I write. I manage the Settings Bundle (or any app settings, thru a Singleton class), my <a href="http://blog.mugunthkumar.com/coding/iphone-tutorial-–-in-app-purchases/">MKStoreManager</a> for doing in-app purchases is a Singleton class. Even in Apple&#8217;s own code you can see some Singletons like UIApplication, Reachability (from the Reachability example), UIDevice and such. You normally access them through an exposed instance of the class. Ex: sharedApplication or currentDevice etc.,</p>
<p>The advantage of using a Singleton pattern is, the class completely isolates you from what it is supposed to do. For example, if you are using my MKStoreManager for doing your in-app purchases, you might have noticed that the four classes you downloaded will take care of all the in-app purchase nitty gritty code by completely encapsulating the Apple&#8217;s StoreKit. You have to write just 3-5 lines of code to make a real purchase.</p>
<p>Singleton is a very powerful way to create &#8220;global&#8221; classes that might otherwise end up in your AppDelegate. Matt Gallagher from Cocoawithlove has an excellent article on why cluttering your AppDelegate might be a problem, read it <a href="http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html">on his blog here</a>.</p>
<p>Though it&#8217;s very easy to create a Singleton class, to make things even easier, I wrote a XCode template which is loosely based on <a href="http://iphonedevelopment.blogspot.com/2010/08/nsoperation-xcode-file-template.html">Jeff Lamarche</a>&#8216;s NSOperation template.</p>
<p>Download the file from Attachments section. Extract the file from Command line using</p>
<pre>unzip SingletonTemplate.zip -d /</pre>
<h3>Attachments</h3>
<p>You can download the file from here</p>
<p><a href="http://blog.mugunthkumar.com/wp-content/uploads/SingletonTemplate.zip">SingletonTemplate</a></p>
<h3>Warning</h3>
<p>This overwrites the built in TemplateChooser.plist file. If your XCode installation is vanilla, you don&#8217;t have to worry about this. But if you have installed any custom templates, you might lose them all.</p>
<p>When you are done, open XCode and click File -&gt; New File.</p>
<p>You will see a prompt like this.</p>
<p style="text-align: center;"><a href="http://blog.mugunthkumar.com/wp-content/uploads/Xcode-template.png"><img class="aligncenter size-full wp-image-826" title="Xcode template" src="http://blog.mugunthkumar.com/wp-content/uploads/Xcode-template.png" alt="" width="440" height="358" /></a></p>
<p>Choose Cocoa Touch classes and choose Objective-C class. You will see an additional option in the &#8220;Subclass of&#8221; combo box. Choose NSObject based Singleton and click finish.</p>
<p>You will get a boiler plate class that you can use it as as a Singleton.</p>
<p>Hope this helps.</p>
<p>In my next post, I&#8217;ll be writing on how to encapsulate your Settings bundle using a Singleton pattern. Keep coming back.</p>
<p>&#8211;</p>
<p>Mugunth</p>
<p><map name='google_ad_map_825_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/825?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_825_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=825&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fxcode-tip-singleton-class-template%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=XCode+Tip%3A+Objective-C+Singleton+Class+Template+-+http://mk.sg/7e&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/&amp;title=XCode+Tip%3A+Objective-C+Singleton+Class+Template&amp;srcUrl=http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/&amp;srcTitle=XCode+Tip%3A+Objective-C+Singleton+Class+Template&amp;snippet=I%20have%20a%20habit%20of%20creating%20Singleton%20pattern%20classes%20for%20nearly%20every%20application%20I%20write.%20I%20manage%20the%20Settings%20Bundle%20%28or%20any%20app%20settings%2C%20thru%20a%20Singleton%20class%29%2C%20my%20MKStoreManager%20for%20doing%20in-app%20purchases%20is%20a%20Singleton%20class.%20Even%20in%20Apple%27s%20own%20code%20you%20can%20see%20some%20Singletons%20like%20UIApplic" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/&amp;title=XCode+Tip%3A+Objective-C+Singleton+Class+Template" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/&amp;t=XCode+Tip%3A+Objective-C+Singleton+Class+Template" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=XCode+Tip%3A+Objective-C+Singleton+Class+Template&amp;link=http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=XCode+Tip%3A+Objective-C+Singleton+Class+Template&amp;body=Link: http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%20have%20a%20habit%20of%20creating%20Singleton%20pattern%20classes%20for%20nearly%20every%20application%20I%20write.%20I%20manage%20the%20Settings%20Bundle%20%28or%20any%20app%20settings%2C%20thru%20a%20Singleton%20class%29%2C%20my%20MKStoreManager%20for%20doing%20in-app%20purchases%20is%20a%20Singleton%20class.%20Even%20in%20Apple%27s%20own%20code%20you%20can%20see%20some%20Singletons%20like%20UIApplic" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/&amp;title=XCode+Tip%3A+Objective-C+Singleton+Class+Template" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-scheduling-local-notifications-using-a-singleton-class/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Scheduling Local Notifications using a Singleton class'>iPhone Tutorial: Scheduling Local Notifications using a Singleton class</a> <small>In iOS 4, Apple introduced a new way to send...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/bit-ly-wrapper-objective-c-iphone/' rel='bookmark' title='Permanent Link: bit.ly wrapper for Objective-C/iPhone'>bit.ly wrapper for Objective-C/iPhone</a> <small>Continuing from my part 1, in this section, we will...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Better way to check capabilities of iOS devices'>iPhone Tutorial: Better way to check capabilities of iOS devices</a> <small>The iPhone OS started off with a single device, the...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/CJbsXJ20KC0-cJ8RA4qyfts38-0/0/da"><img src="http://feedads.g.doubleclick.net/~a/CJbsXJ20KC0-cJ8RA4qyfts38-0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CJbsXJ20KC0-cJ8RA4qyfts38-0/1/da"><img src="http://feedads.g.doubleclick.net/~a/CJbsXJ20KC0-cJ8RA4qyfts38-0/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/xcode-tip-singleton-class-template/</feedburner:origLink></item>
		<item>
		<title>Display Comparison : iPad vs iPhone 4 vs Nexus One</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/4eFdjqMBkQY/</link>
		<comments>http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 03:25:05 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone 4]]></category>
		<category><![CDATA[nexus one]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=818</guid>
		<description><![CDATA[The following photo was taken using my hi-res super macro camera, Canon S5 IS. A quick comparison in the displays of iPad, iPhone 4 and Nexus One. The iPhone 4 display is clearly superior. You can download a higher resolution version of this image by right clicking the above image and clicking &#8220;Save link as&#8230;&#8221; [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">The following photo was taken using my hi-res super macro camera, Canon S5 IS.</p>
<p style="text-align: left;">A quick comparison in the displays of iPad, iPhone 4 and Nexus One. The iPhone 4 display is clearly superior.</p>
<p style="text-align: left;">
<p style="text-align: center;"><a href="http://mugunthkumar.com/embedded/comparison.png"><img class="aligncenter size-large wp-image-819" title="Comparison" src="http://blog.mugunthkumar.com/wp-content/uploads/comparison-small-1024x307.png" alt="" width="574" height="172" /></a></p>
<p style="text-align: center;">
<p style="text-align: left;">You can download a higher resolution version of this image by right clicking the above image and clicking &#8220;Save link as&#8230;&#8221; Be forewarned, most low end computers can&#8217;t even open that image (as on the date of writing this). The image is fairly large at 10000X3000 pixels at 300PPI. It&#8217;s about 35MB to download.</p>
<p style="text-align: left;">If you zoom the image, you will notice that even at this high resolution, the pixels of iPhone 4 are not visible.</p>
<p style="text-align: left;">
<p style="text-align: left;">&#8211;</p>
<p style="text-align: left;">Mugunth</p>
<p><map name='google_ad_map_818_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/818?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_818_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=818&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Ftech%2Fdisplay-comparison-ipad-vs-iphone-4-vs-nexus-one%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One+-+http://mk.sg/7d&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/&amp;title=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One&amp;srcUrl=http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/&amp;srcTitle=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One&amp;snippet=The%20following%20photo%20was%20taken%20using%20my%20hi-res%20super%20macro%20camera%2C%20Canon%20S5%20IS.%0D%0AA%20quick%20comparison%20in%20the%20displays%20of%20iPad%2C%20iPhone%204%20and%20Nexus%20One.%20The%20iPhone%204%20display%20is%20clearly%20superior.%0D%0A%0D%0A%0D%0A%0D%0AYou%20can%20download%20a%20higher%20resolution%20version%20of%20this%20image%20by%20right%20clicking%20the%20above%20image%20and%20clicki" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/&amp;title=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/&amp;t=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One&amp;link=http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One&amp;body=Link: http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A The%20following%20photo%20was%20taken%20using%20my%20hi-res%20super%20macro%20camera%2C%20Canon%20S5%20IS.%0D%0AA%20quick%20comparison%20in%20the%20displays%20of%20iPad%2C%20iPhone%204%20and%20Nexus%20One.%20The%20iPhone%204%20display%20is%20clearly%20superior.%0D%0A%0D%0A%0D%0A%0D%0AYou%20can%20download%20a%20higher%20resolution%20version%20of%20this%20image%20by%20right%20clicking%20the%20above%20image%20and%20clicki" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/&amp;title=Display+Comparison+%3A+iPad+vs+iPhone+4+vs+Nexus+One" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/iE0qfuQSH1eddVwAJjtVZMsIlE8/0/da"><img src="http://feedads.g.doubleclick.net/~a/iE0qfuQSH1eddVwAJjtVZMsIlE8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/iE0qfuQSH1eddVwAJjtVZMsIlE8/1/da"><img src="http://feedads.g.doubleclick.net/~a/iE0qfuQSH1eddVwAJjtVZMsIlE8/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/tech/display-comparison-ipad-vs-iphone-4-vs-nexus-one/</feedburner:origLink></item>
		<item>
		<title>Tutorial: Setting up Git on your Mac</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/zcJT0EOAWx8/</link>
		<comments>http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 06:15:20 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac os X]]></category>
		<category><![CDATA[source code control]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=807</guid>
		<description><![CDATA[Every programmer will one day realize that Git is easily the best available source code control on the planet. I was a fervent follower of SVN so far and even wrote SVN is the best source code control. The only reason that daunted me to use Git is to use the command line interface. But, if [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Every programmer will one day realize that Git is easily the best available source code control on the planet. I was a fervent follower of SVN so far and <a href="http://blog.mugunthkumar.com/coding/setting-up-xcode-3-0-with-svn/">even wrote </a> SVN is the best source code control. The only reason that daunted me to use Git is to use the command line interface. But, if you master the command line, Git is all yours to command. Moreover, with tighter integration of XCode 4 and Git, I think it&#8217;s a great idea to learn about Git and migrate to Git from SVN.</p>
<p>In this article, I&#8217;ll take you through the bare minimum steps to setup git on your computer and start XCoding.</p>
<p>Before we delve into the detailed steps, a couple of words about Git.<br />
Git, unlike SVN is a <strong>distributed</strong> version control system. which means, when you commit a repository, you actually don&#8217;t commit to the central repo. In Git, every user has his own local repo and he at his own will can &#8220;push&#8221; changes to the central repo.</p>
<p>Once you get this concept of distributed source code control, Git is a cakewalk. Believe me.<br />
Now, let&#8217;s get started.</p>
<h3>Step 1: Install Git.</h3>
<p>Yeah, a no brainer step, pick up the installer from <a href="http://code.google.com/p/git-osx-installer/">here</a></p>
<h3>Step 2: Generate your keys</h3>
<p>Git uses a private/public  key authentication to verify YOU before you access the remote git repository.<br />
<code>ssh-keygen -t rsa -C ""</code><br />
Just keep on pressing enter for any question it asks till your public key gets generated</p>
<h3>Step 3: Copy keys to clipboard</h3>
<p>But, why is this a separate step? Because you can do it easily through command line.<br />
<code>cat ~/.ssh/id_rsa.pub | pbcopy</code></p>
<p>Type this to &#8220;copy&#8221; the public key to clipboard (Equivalent of Cmd + C)</p>
<h3>Step 4: Add this public key to your remote repository</h3>
<p>Update your public key into your remote Git Repository. All Git Repositories like github, sourcerepo, beanstalk provide a interface to add your public key to your user profile.<br />
That&#8217;s it! Now you can start using Git. See it&#8217;s that simple.</p>
<p>Now we shall start using Git to commit your changes and push it to the central repository.</p>
<h3>Step 5: Create your first Git local repository</h3>
<p>To get started, create a directory and cd into that directory</p>
<p><code>mkdir GitFolder<br />
cd GitFolder</code></p>
<h3>Step 6: Initialize your local repository</h3>
<p>Initialize a git repo in that new directory by typing in the following command.<br />
<code>git init</code></p>
<p>This command initializes the empty directory you created with a git repository. Unlike SVN, git repositories are not stored in some different location. The git repo is stored within the folder you created inside a hidden folder called &#8220;.git&#8221;</p>
<h3>Step 7: Clone a remote repository</h3>
<p><code>git clone "" .</code><br />
Now clone your remote URL to your current directory (.)<br />
(Be sure to type the last &#8220;.&#8221;, it&#8217;s not full stop)</p>
<p>That&#8217;s it.<br />
Your GitRepo is now on your local drive.</p>
<h3>Step 8: Making your first commit</h3>
<p>Now, let&#8217;s make a change and commit this to your local repo. For this, edit any file in the project and come back to Terminal.<br />
Type<br />
<code>git diff</code></p>
<p>You should see the changes you made on the console. To commit these changes, type<br />
<code>git commit -a -m "Your commit comment"</code></p>
<h3>Step 9: Pushing your changes to remote repository</h3>
<p>Now, remember that, Git is a distributed version control system, so, these changes aren&#8217;t yet available to other users/contributors of the same remote repository. You must &#8220;push&#8221; these changes back to the remote repository. For doing this,<br />
you have to configure a remote location using the following command.<br />
<code>git remote add "remote location name" ""</code><br />
Your remote location starts with ssh:// and looks like this<br />
<code>ssh://github.com/foo/bar/MyGreatiPhoneApp.git</code><br />
Your &#8220;remote location name&#8221; can be anything and most tutorials like those from github tend to use &#8220;origin&#8221;</p>
<h3>Step 10:&#8221;Pushing&#8221; your local commits</h3>
<p>Now that you have configured a remote location,<br />
<code>git push "your remote location name" master</code><br />
or in short,<br />
<code>git push origin master</code></p>
<p>Now your code has been successfully committed to the central repo.</p>
<h3>Step 11: &#8220;Checking out&#8221; a remote repository</h3>
<p>&#8220;Checking out&#8221; from a git repository is called as &#8220;pull&#8221;. The command for that is very similar<br />
<code>git pull origin master</code></p>
<p>Note that cloning a git repo is to copy the entire repository where as pulling just updates the latest incremental changes. Unfortunately (or fortunately) there is no equivalent of clone in SVN. Just remember that you are doing this step because Git is a distributed revision control system.</p>
<h3>Step 12: Setting up a default remote location</h3>
<p>You can setup this location permanently as your default remote location by typing in this command<br />
<code>git config branch.master.remote "your remote location name"</code></p>
<p>From now on, you can just type git push and git pull to commit and retrieve changes to and from the repository.</p>
<h3>Step 13: Adding exclusions</h3>
<p>Every project always contains some auto generated &#8220;build&#8221; folders that need to be excluded from being committed. To do this, you use a &#8220;.gitignore&#8221; file. Create a .gitignore file and type the relative directory addresses one per line and Git automatically ignores them. My .gitignore file usually looks like this<br />
<code>build/<br />
.gitignore<br />
fbconnect/src/build/*<br />
MyiPhoneApp.xcodeproj/mugunthkumar*<br />
</code><br />
The first line is to exclude the build directory, the second line is to exclude this .gitignore file and the third line is to exclude the fbconnect (or any third party library)&#8217;s build folder and the last line is to exclude your personal XCode editor settings from being committed into the repository.</p>
<p>So, that&#8217;s it for setting up Git for your great iPhone App.</p>
<p>Git has even more powerful tools to branch and merge locally and pushing/ignoring a certain branch. But I will leave that for another post.</p>
<p>Happy Gitting.</p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_807_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/807?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_807_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=807&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Farticles%2Ftutorial-setting-up-git-on-your-mac%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Tutorial%3A+Setting+up+Git+on+your+Mac+-+http://mk.sg/7c&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/&amp;title=Tutorial%3A+Setting+up+Git+on+your+Mac&amp;srcUrl=http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/&amp;srcTitle=Tutorial%3A+Setting+up+Git+on+your+Mac&amp;snippet=Every%20programmer%20will%20one%20day%20realize%20that%20Git%20is%20easily%20the%20best%20available%20source%20code%20control%20on%20the%20planet.%20I%20was%20a%20fervent%20follower%20of%20SVN%20so%20far%C2%A0and%20even%20wrote%20%20SVN%20is%20the%20best%20source%20code%20control.%20The%20only%20reason%20that%20daunted%20me%20to%20use%20Git%20is%20to%20use%20the%20command%20line%20interface.%20But%2C%20if%20you%20mas" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/&amp;title=Tutorial%3A+Setting+up+Git+on+your+Mac" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/&amp;t=Tutorial%3A+Setting+up+Git+on+your+Mac" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Tutorial%3A+Setting+up+Git+on+your+Mac&amp;link=http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=Tutorial%3A+Setting+up+Git+on+your+Mac&amp;body=Link: http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Every%20programmer%20will%20one%20day%20realize%20that%20Git%20is%20easily%20the%20best%20available%20source%20code%20control%20on%20the%20planet.%20I%20was%20a%20fervent%20follower%20of%20SVN%20so%20far%C2%A0and%20even%20wrote%20%20SVN%20is%20the%20best%20source%20code%20control.%20The%20only%20reason%20that%20daunted%20me%20to%20use%20Git%20is%20to%20use%20the%20command%20line%20interface.%20But%2C%20if%20you%20mas" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/&amp;title=Tutorial%3A+Setting+up+Git+on+your+Mac" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/G_4WOayQwm4gHYfm8h34FQ2ghQY/0/da"><img src="http://feedads.g.doubleclick.net/~a/G_4WOayQwm4gHYfm8h34FQ2ghQY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/G_4WOayQwm4gHYfm8h34FQ2ghQY/1/da"><img src="http://feedads.g.doubleclick.net/~a/G_4WOayQwm4gHYfm8h34FQ2ghQY/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/articles/tutorial-setting-up-git-on-your-mac/</feedburner:origLink></item>
		<item>
		<title>iPhone Dev Tip: Breaking the AdHoc Provisioning Nightmare on Windows</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/8asgWJCn42I/</link>
		<comments>http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 11:27:35 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[provisioning]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=797</guid>
		<description><![CDATA[Anti-DRM fans might quip, but iPhone Developers love this digital signatures and provisioning as it reduces piracy dramatically. But all these aren&#8217;t free. Provisioning comes with a cost, especially when you write a iPhone app and want to share it with your friends/clients for beta testing. Apple has an excellent documentation on how to do [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Anti-DRM fans might quip, but iPhone Developers love this digital signatures and provisioning as it reduces piracy dramatically. But all these aren&#8217;t free. Provisioning comes with a cost, especially when you write a iPhone app and want to share it with your friends/clients for beta testing. Apple has an <a href="http://adcdownload.apple.com/iphone/iphone_developer_program_user_guides/iphone_developer_program_user_guide__standard_program_v2.6__final_3410.pdf">excellent documentation</a> on how to do an AdHoc build. Yet still, most users stumble upon especially when they have to make a build and send it to their testers/clients who are on Windows I&#8217;m not going to rewrite the entire AdHoc provisioning process here. This post is exclusively for iPhone developers whose testers/clients are Windows users who would like to provision the beta versions onto their iPhones using iTunes on Windows.</p>
<p>As usual, you prepare a AdHoc build and zip the .app bundle, attach it to the email along with the mobile provisioning profile and send it to your customer. On macs, things are pretty straight forward. On Windows, however, your customers are prone to fall into these common pitfalls which might cause a troublesome nightmare for you.</p>
<p>First Pitfall:<br />
Extracting the .zip file you sent using Windows Explorer&#8217;s built in Compression Engine.</p>
<p>I repeat. DON&#8217;T DON&#8217;T DON&#8217;T extract the zip file using the Windows&#8217; explorer&#8217;s built in &#8220;Extract Here&#8221; command. The default compression engine bundled with Windows messes up the CRCs by adding temporary files into the .app bundle. Ask your testers to use a better de-compression tool like 7-Zip, WinZip or WinRar.</p>
<p>Second Pitfall:<br />
Opening the .app folder out of &#8220;curiosity&#8221; to &#8220;see&#8221; what&#8217;s inside.</p>
<p>Never double-click and &#8220;open&#8221; the extracted .app &#8220;folder&#8221; (On windows the .app bundle appears as a folder) . Windows is a sh**. I agree. It automatically creates a &#8220;Thumbs.db/Desktop.ini/folder.htt&#8221; (some created by Virus, some by Windows) file whenever you access a folder and that again changes the CRC of the bundle. Just drag the .app &#8220;folder&#8221; immediately after extracting into iTunes. Also drag the provisioning profile into iTunes and sync the app.</p>
<p>If you think your users&#8217; might not follow all these steps, you can send them the .IPA file instead of the compressed .app bundle. This .IPA file can be generated on your mac by dragging the .app bundle into iTunes. When you drag the .app bundle into your iTunes library, it internally creates a .IPA file. This IPA file can be located in Finder from iTunes. Just Cmd click your app on iTunes and click &#8220;Show in Finder&#8221;. Send this .IPA file (and the mobile provisioning file) to your testers.</p>
<p>Hope that clears the air around AdHoc provisioning on Windows.</p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_797_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/797?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_797_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=797&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Ftech%2Fiphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows+-+http://mk.sg/7b&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/&amp;title=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows&amp;srcUrl=http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/&amp;srcTitle=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows&amp;snippet=Anti-DRM%20fans%20might%20quip%2C%20but%20iPhone%20Developers%20love%20this%20digital%20signatures%20and%20provisioning%20as%20it%20reduces%20piracy%20dramatically.%20But%20all%20these%20aren%27t%20free.%20Provisioning%20comes%20with%20a%20cost%2C%20especially%20when%20you%20write%20a%20iPhone%20app%20and%20want%20to%20share%20it%20with%20your%20friends%2Fclients%20for%20beta%20testing.%20Apple%20ha" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/&amp;title=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/&amp;t=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows&amp;link=http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows&amp;body=Link: http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Anti-DRM%20fans%20might%20quip%2C%20but%20iPhone%20Developers%20love%20this%20digital%20signatures%20and%20provisioning%20as%20it%20reduces%20piracy%20dramatically.%20But%20all%20these%20aren%27t%20free.%20Provisioning%20comes%20with%20a%20cost%2C%20especially%20when%20you%20write%20a%20iPhone%20app%20and%20want%20to%20share%20it%20with%20your%20friends%2Fclients%20for%20beta%20testing.%20Apple%20ha" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/&amp;title=iPhone+Dev+Tip%3A+Breaking+the+AdHoc+Provisioning+Nightmare+on+Windows" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>No related posts.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/mI9VKvVzsiIdSprxNwNYWnDRm88/0/da"><img src="http://feedads.g.doubleclick.net/~a/mI9VKvVzsiIdSprxNwNYWnDRm88/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mI9VKvVzsiIdSprxNwNYWnDRm88/1/da"><img src="http://feedads.g.doubleclick.net/~a/mI9VKvVzsiIdSprxNwNYWnDRm88/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/tech/iphone-dev-tip-breaking-the-adhoc-provisioning-nightmare-on-windows/</feedburner:origLink></item>
		<item>
		<title>iOS4 Issue: NSURLConnection and NSOperation</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/MP-kEclGGIg/</link>
		<comments>http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 13:25:43 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ios4]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=793</guid>
		<description><![CDATA[Everyone knows NSOperation is easily the best way to automatically gain powerful multi-threading on iOS/Mac platforms. However, recently for one of my apps, I faced a issue where, the NSURLConnection&#8217;s initWithRequest method doesn&#8217;t automatically start even if you forcefully send the &#8220;start&#8221; message. For example the below code works perfectly on iPhone OS 3.1 and [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Follow Cost API and a open source wrapper'>iPhone Tutorial: Follow Cost API and a open source wrapper</a> <small>What is Follow Cost? Follow Cost is a interesting and...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Everyone knows NSOperation is easily the best way to automatically gain powerful multi-threading on iOS/Mac platforms. However, recently for one of my apps, I faced a issue where, the NSURLConnection&#8217;s initWithRequest method doesn&#8217;t automatically start even if you forcefully send the &#8220;start&#8221; message.</p>
<p>For example the below code works perfectly on iPhone OS 3.1 and below but fails on iOS 4.</p>
<p><code>- (void)start<br />
{<br />
    [self willChangeValueForKey:@"isExecuting"];<br />
    _isExecuting = YES;<br />
    [self didChangeValueForKey:@"isExecuting"];</p>
<p>    NSURLRequest * request = [NSURLRequest requestWithURL:_url];<br />
    _connection = [[NSURLConnection alloc] initWithRequest:request<br />
                                                  delegate:self];<br />
}</code></p>
<p>Seems like Apple has made a change where in if the NSURLConnection&#8217;s initWithRequest method is called from a thread that&#8217;s not the main thread, it doesn&#8217;t start downloading the URL contents immediately. The bug fix for this issue is fortunately simple.</p>
<p><code>- (void)start<br />
{<br />
    [self willChangeValueForKey:@"isExecuting"];<br />
    _isExecuting = YES;<br />
    [self didChangeValueForKey:@"isExecuting"];</p>
<p>    NSURLRequest * request = [NSURLRequest requestWithURL:_url];<br />
    _connection = [[NSURLConnection alloc] initWithRequest:request<br />
                                                  delegate:self];</p>
<p>        <em>//iOS 4 bug fix<br />
	if (![NSThread isMainThread])<br />
	{<br />
		[self performSelectorOnMainThread:@selector(start)<br />
							   withObject:nil waitUntilDone:NO];<br />
		return;<br />
	}</em><br />
}</code></p>
<p>Hope this post solves your problem.</p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_793_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/793?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_793_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=793&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fios4-issue-nsurlconnection-and-nsoperation%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=iOS4+Issue%3A+NSURLConnection+and+NSOperation+-+http://mk.sg/7a&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/&amp;title=iOS4+Issue%3A+NSURLConnection+and+NSOperation&amp;srcUrl=http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/&amp;srcTitle=iOS4+Issue%3A+NSURLConnection+and+NSOperation&amp;snippet=Everyone%20knows%20NSOperation%20is%20easily%20the%20best%20way%20to%20automatically%20gain%20powerful%20multi-threading%20on%20iOS%2FMac%20platforms.%20However%2C%20recently%20for%20one%20of%20my%20apps%2C%20I%20faced%20a%20issue%20where%2C%20the%20NSURLConnection%27s%20initWithRequest%20method%20doesn%27t%20automatically%20start%20even%20if%20you%20forcefully%20send%20the%20%22start%22%20message" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/&amp;title=iOS4+Issue%3A+NSURLConnection+and+NSOperation" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/&amp;t=iOS4+Issue%3A+NSURLConnection+and+NSOperation" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=iOS4+Issue%3A+NSURLConnection+and+NSOperation&amp;link=http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=iOS4+Issue%3A+NSURLConnection+and+NSOperation&amp;body=Link: http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Everyone%20knows%20NSOperation%20is%20easily%20the%20best%20way%20to%20automatically%20gain%20powerful%20multi-threading%20on%20iOS%2FMac%20platforms.%20However%2C%20recently%20for%20one%20of%20my%20apps%2C%20I%20faced%20a%20issue%20where%2C%20the%20NSURLConnection%27s%20initWithRequest%20method%20doesn%27t%20automatically%20start%20even%20if%20you%20forcefully%20send%20the%20%22start%22%20message" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/&amp;title=iOS4+Issue%3A+NSURLConnection+and+NSOperation" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Follow Cost API and a open source wrapper'>iPhone Tutorial: Follow Cost API and a open source wrapper</a> <small>What is Follow Cost? Follow Cost is a interesting and...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/Tu-qudAFo16d34c0J86BK9mvkBs/0/da"><img src="http://feedads.g.doubleclick.net/~a/Tu-qudAFo16d34c0J86BK9mvkBs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Tu-qudAFo16d34c0J86BK9mvkBs/1/da"><img src="http://feedads.g.doubleclick.net/~a/Tu-qudAFo16d34c0J86BK9mvkBs/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/ios4-issue-nsurlconnection-and-nsoperation/</feedburner:origLink></item>
		<item>
		<title>iPhone Tutorial: How to send In-App SMS</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/n2w-LZffdF0/</link>
		<comments>http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 10:37:39 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=769</guid>
		<description><![CDATA[Officially, iPhone OS 4 is out of NDA and I can&#8217;t write a post on this. If you have been reading my blogs, you might already know how to send a in-app email Sending a in-app SMS is very similar to this, but with subtle differences. Prior to iPhone OS 4, developers have to depend [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Elegant way to send formatted In-App email'>iPhone Tutorial: Elegant way to send formatted In-App email</a> <small>By now, most of you know how to send emails...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Better way to check capabilities of iOS devices'>iPhone Tutorial: Better way to check capabilities of iOS devices</a> <small>The iPhone OS started off with a single device, the...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free'>iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free</a> <small>In-App purchases is a great way for developers to upsell...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Officially, iPhone OS 4 is out of NDA and I can&#8217;t write a post on this. If you have been reading my blogs, you might already know how to send a <a href="http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/">in-app email</a> Sending a in-app SMS is very similar to this, but with subtle differences.</p>
<p>Prior to iPhone OS 4, developers have to depend on</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> openURL<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;sms:12345678&quot;</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>The problem with this is not just that it closes your app, but there is no way to specify the body content of the SMS. Secondly, you are restricted to send the SMS to only one person. However, with the new MessageUI SMS controller, you can send SMS to multiple people at the same time. You can also pre-populate the SMS body field.<br />
Developers of famous apps like Whatsapp Messenger, copy the SMS text content to clipboard and open the SMS app to allow users to paste the content. But with this newly allowed In-App SMS sheet, users can send SMS without quitting the app.</p>
<p>So, Let&#8217;s get started.</p>
<h3>Step 1:</h3>
<p>Import the MessageUI Framework into your project and #import the header file  into the &#8220;.h&#8221; file of your controller where you want to open the In-App SMS sheet.</p>
<h3>Step 2:</h3>
<p>You might already have a button handler IBAction where you want to send the SMS. If not create a Button on your XIB file and write IBActions for it.</p>
<h3>Step 3:</h3>
<p>The real code</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span> sendInAppSMS<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> sender
<span style="color: #002200;">&#123;</span>
	MFMessageComposeViewController <span style="color: #002200;">*</span>controller <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MFMessageComposeViewController alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>MFMessageComposeViewController canSendText<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
	<span style="color: #002200;">&#123;</span>
		controller.body <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Hello from Mugunth&quot;</span>;
		controller.recipients <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSArray</span> arrayWithObjects<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;12345678&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;87654321&quot;</span>, <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
		controller.messageComposeDelegate <span style="color: #002200;">=</span> self;
		<span style="color: #002200;">&#91;</span>self presentModalViewController<span style="color: #002200;">:</span>controller animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>The most important part here is the line [MFMessageComposeViewController canSendText].<br />
When sending a in-app email, you can choose to ignore this (atleast as of now) because most of the devices would have upgraded to iPhone OS 3 and all those devices would have the ability to send in-app email. However, the same doesn&#8217;t apply to SMS. Remember that even if a device is running iPhone OS 4, if it&#8217;s an iPod touch, it will never be abel to send SMS within app.<br />
In this case, I have used a if condition to send the SMS. Practically speaking, you should enable/disable the button the user taps to send the sms based on this. You can add the code that does this in your viewDidLoad method.</p>
<p>Secondly, you have to set the messageComposeDelegate to self and not delegate. If you set the controller.delegate to self, you will not get the didFinishWithResult callback and the In-App SMS sheet will not close.</p>
<h3>Step 4:</h3>
<p>Implement Delegate Callbacks.<br />
In your header file, implement the callbacks, MFMessageComposeViewControllerDelegate and UINavigationControllerDelegate. If you don&#8217;t you will get a warning at the line,</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"> controller.delegate <span style="color: #002200;">=</span> self;</pre></div></div>

<p>You have to handle a callback method of MFMessageComposeViewControllerDelegate so as to dismiss the modal view controller.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>messageComposeViewController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>MFMessageComposeViewController <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>controller didFinishWithResult<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>MessageComposeResult<span style="color: #002200;">&#41;</span>result
<span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">switch</span> <span style="color: #002200;">&#40;</span>result<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #a61390;">case</span> MessageComposeResultCancelled<span style="color: #002200;">:</span>
			NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Cancelled&quot;</span><span style="color: #002200;">&#41;</span>;
			<span style="color: #a61390;">break</span>;
		<span style="color: #a61390;">case</span> MessageComposeResultFailed<span style="color: #002200;">:</span>
			UIAlertView <span style="color: #002200;">*</span>alert <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIAlertView alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;MyApp&quot;</span> message<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Unknown Error&quot;</span>
														   delegate<span style="color: #002200;">:</span>self cancelButtonTitle<span style="color: #002200;">:</span>@”OK” otherButtonTitles<span style="color: #002200;">:</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
			<span style="color: #002200;">&#91;</span>alert show<span style="color: #002200;">&#93;</span>;
			<span style="color: #002200;">&#91;</span>alert release<span style="color: #002200;">&#93;</span>;
			<span style="color: #a61390;">break</span>;
		<span style="color: #a61390;">case</span> MessageComposeResultSent<span style="color: #002200;">:</span>
&nbsp;
			<span style="color: #a61390;">break</span>;
		<span style="color: #a61390;">default</span><span style="color: #002200;">:</span>
			<span style="color: #a61390;">break</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #002200;">&#91;</span>self dismissModalViewControllerAnimated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>That&#8217;s it. Your app should now be able to send SMS using the new Message UI sheet.</p>
<h2></h2>
<h2>Where the heck is MMS in this tutorial?</h2>
<p>As on date, the MFMessageComposeViewController doesn&#8217;t support sending MMS. The controller.body is a NSString and setting a NSData pointer obviously crashes the app. Hopefully, one day, Apple will allow sending In-App MMS and I&#8217;ll probably blog about that too&#8230;</p>
<p><map name='google_ad_map_769_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/769?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_769_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=769&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fiphone-tutorial-how-to-send-in-app-sms%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=iPhone+Tutorial%3A+How+to+send+In-App+SMS+-+http://mk.sg/79&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/&amp;title=iPhone+Tutorial%3A+How+to+send+In-App+SMS&amp;srcUrl=http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/&amp;srcTitle=iPhone+Tutorial%3A+How+to+send+In-App+SMS&amp;snippet=Officially%2C%20iPhone%20OS%204%20is%20out%20of%20NDA%20and%20I%20can%27t%20write%20a%20post%20on%20this.%20If%20you%20have%20been%20reading%20my%20blogs%2C%20you%20might%20already%20know%20how%20to%20send%20a%20in-app%20email%20Sending%20a%20in-app%20SMS%20is%20very%20similar%20to%20this%2C%20but%20with%20subtle%20differences.%0D%0A%0D%0APrior%20to%20iPhone%20OS%204%2C%20developers%20have%20to%20depend%20on%0D%0A%5B%5BUIApplicati" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/&amp;title=iPhone+Tutorial%3A+How+to+send+In-App+SMS" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/&amp;t=iPhone+Tutorial%3A+How+to+send+In-App+SMS" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=iPhone+Tutorial%3A+How+to+send+In-App+SMS&amp;link=http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=iPhone+Tutorial%3A+How+to+send+In-App+SMS&amp;body=Link: http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Officially%2C%20iPhone%20OS%204%20is%20out%20of%20NDA%20and%20I%20can%27t%20write%20a%20post%20on%20this.%20If%20you%20have%20been%20reading%20my%20blogs%2C%20you%20might%20already%20know%20how%20to%20send%20a%20in-app%20email%20Sending%20a%20in-app%20SMS%20is%20very%20similar%20to%20this%2C%20but%20with%20subtle%20differences.%0D%0A%0D%0APrior%20to%20iPhone%20OS%204%2C%20developers%20have%20to%20depend%20on%0D%0A%5B%5BUIApplicati" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/&amp;title=iPhone+Tutorial%3A+How+to+send+In-App+SMS" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Elegant way to send formatted In-App email'>iPhone Tutorial: Elegant way to send formatted In-App email</a> <small>By now, most of you know how to send emails...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/' rel='bookmark' title='Permanent Link: iPhone Tutorial: Better way to check capabilities of iOS devices'>iPhone Tutorial: Better way to check capabilities of iOS devices</a> <small>The iPhone OS started off with a single device, the...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free'>iPhone Tutorial &#8211; Enabling reviewers to use your In-App purchases for free</a> <small>In-App purchases is a great way for developers to upsell...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/28IpA_qqzysO-Ioau76Xr8qkP6I/0/da"><img src="http://feedads.g.doubleclick.net/~a/28IpA_qqzysO-Ioau76Xr8qkP6I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/28IpA_qqzysO-Ioau76Xr8qkP6I/1/da"><img src="http://feedads.g.doubleclick.net/~a/28IpA_qqzysO-Ioau76Xr8qkP6I/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/</feedburner:origLink></item>
		<item>
		<title>Random Thoughts on iPad</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/vZbrnFAuprw/</link>
		<comments>http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/#comments</comments>
		<pubDate>Thu, 06 May 2010 03:53:16 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=718</guid>
		<description><![CDATA[If you are not Steve Ballmer, you must have realized by now that iPad development is going to be the next big thing for the computing ecosystem. There are several reasons for this. 3 years ago, when iPhone was launched, Apple targeted the so called &#8220;busy&#8221; users (no not me). Most of these users, use [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/' rel='bookmark' title='Permanent Link: Save As vs Exporting &#8211; Why Apple excels at UI Design?'>Save As vs Exporting &#8211; Why Apple excels at UI Design?</a> <small>Most users think, Mac UI is all about slick graphics...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div id="attachment_757" class="wp-caption alignleft" style="width: 160px"><a href="http://blog.mugunthkumar.com/wp-content/uploads/ipad.jpg"><img src="http://blog.mugunthkumar.com/wp-content/uploads/ipad-150x150.jpg" alt="Apple iPad" title="iPad" width="150" height="150" class="size-thumbnail wp-image-757" /></a><p class="wp-caption-text">iPad</p></div>If you are not Steve Ballmer, you must have realized by now that iPad development is going to be the next big thing for the computing ecosystem. There are several reasons for this. 3 years ago, when iPhone was launched, Apple targeted the so called &#8220;busy&#8221; users (no not me). Most of these users, use apps for &#8220;consuming&#8221; content rather than actively creating it. Usage statistics from pinchmedia and flurry, report that <strong><em>most</em></strong> users don&#8217;t have an app open for more than a minute or so coinciding with the fact that apps on the iPhone are mostly used for content consumption rather than content creation. As such, there wasn&#8217;t a necessity to cram functionalities into your iPhone app. On the iPad, The larger screen makes it easy to add more features without sacrificing <a href="http://blog.mugunthkumar.com/tag/usability/">usability</a>. One good example of this is the iPad app, &#8220;Elements&#8221;. Below is a youtube video of the app demonstration.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/nHiEqf5wb3g&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/nHiEqf5wb3g&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>At the time of writing, Elements costs 14.99$. To most of us, it might seem a bit pricey. While a similar printed book, which might not even interactive might cost more, the iPad version is priced comparatively lower especially given the effort the developers have put in the app. (and hence the value you get as a consumer). As the narrator explains, the Elements app is not just an electronic version of the paper book, but something that have been remade completely. Apps like these that take advantage of the huge multi-touch screen is going to be a huge success with the users. Apps like these will be used by users longer than they use a similar iPhone app. A longer usage cycle translates to higher customer satisfaction. So you might not say, &#8220;Did I pay this much for this crap?&#8221;.</p>
<p>Next category of apps like these will be for education related apps for young, growing kids. You might have got expensive &#8220;animal&#8221; book that teaches your kid how the animal looks. Now with the iPad, there would be an app that meows like a cat, barks like a dog and roars like a lion.<br />
Or you can get a slate and chalk app like <a href="http://itunes.apple.com/us/app/chalk-a-simple-drawing-app/id363309475?mt=8">this</a> for a dollar which your kids can draw on.<br />
<a href="http://blog.mugunthkumar.com/wp-content/uploads/309475_2.jpg"><img class="aligncenter size-medium wp-image-725" title="Chalk - A Drawing App" src="http://blog.mugunthkumar.com/wp-content/uploads/309475_2-225x300.jpg" alt="" width="225" height="300" /></a><br />
If you are a Asian (Chinese/Japanese), you could download an app that allows your kids to draw over a dotted <a href="http://en.wikipedia.org/wiki/Kanji">Kanji </a>and teach them how to write a Kanji the right way. I use Kanji Flip and Japanese Flip on iPhone to learn Japanese Kanji.</p>
<p><div id="attachment_726" class="wp-caption aligncenter" style="width: 210px"><a href="http://blog.mugunthkumar.com/wp-content/uploads/photo.png"><img class="size-medium wp-image-726" title="Kanji Flip" src="http://blog.mugunthkumar.com/wp-content/uploads/photo-200x300.png" alt="" width="200" height="300" /></a><p class="wp-caption-text">Kanji Flip Helps you learn Japanese Kanji on your iPhone</p></div>
<p>Probably the developers might come up with an iPad equivalent soon.</p>
<p>The level of interactivity is much higher that, software on these devices becomes more and more intuitive and this could potentially change how our future generation youngsters are molded. As the media industry converges with the software industry, there isn&#8217;t a reason that stops you from becoming a Apple developer.</p>
<p>Now, If Apple could successfully convince e-book publishers to use their platform like they did with the media industry, electronic books will be the next big thing in this decade. Students would find themselves renting textbooks during the course period rather than buying them. <a href="http://www.blackboard.com/">Blackboard</a> has a iPad app that helps students stay in touch with what&#8217;s happening in class. So if your university uses this software, (I know <a href="http://ntu.edu.sg">Nanyang Technological University</a> uses it) you can use this iPad app to go through the courses and course materials.</p>
<p>History has proved that, it&#8217;s not the product that endures. It&#8217;s the killer ecosystem that sustains the product. For example, in 1980s, the sales of IBM PC was boosted just by the software called Lotus 1-2-3. The sales of XBOX 360 was sustained just by one killer game, The Halo Series. On a business sense, these products are called as  <a href="http://en.wikipedia.org/wiki/Killer_application">killer apps</a>. Today we buy computers not for the processor/hardware inside but for its ability to run the software of our choice.</p>
<p>Successful apps like these will drive the iPad as the next generation computing platform and as Apple already says, there is an app for anything, only on the iPhone, that might just be true for the iPad as well.</p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_718_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/718?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_718_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=718&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Farticles%2Frandom-thoughts-on-ipad%2F' /></p>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Random+Thoughts+on+iPad+-+http://mk.sg/72&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/&amp;title=Random+Thoughts+on+iPad&amp;srcUrl=http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/&amp;srcTitle=Random+Thoughts+on+iPad&amp;snippet=If%20you%20are%20not%20Steve%20Ballmer%2C%20you%20must%20have%20realized%20by%20now%20that%20iPad%20development%20is%20going%20to%20be%20the%20next%20big%20thing%20for%20the%20computing%20ecosystem.%20There%20are%20several%20reasons%20for%20this.%203%20years%20ago%2C%20when%20iPhone%20was%20launched%2C%20Apple%20targeted%20the%20so%20called%20%22busy%22%20users%20%28no%20not%20me%29.%20Most%20of%20these%20users%2C%20use%20" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/&amp;title=Random+Thoughts+on+iPad" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/&amp;t=Random+Thoughts+on+iPad" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Random+Thoughts+on+iPad&amp;link=http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="shr-gmail">
			<a href="https://mail.google.com/mail/?ui=2&amp;view=cm&amp;fs=1&amp;tf=1&amp;su=Random+Thoughts+on+iPad&amp;body=Link: http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A If%20you%20are%20not%20Steve%20Ballmer%2C%20you%20must%20have%20realized%20by%20now%20that%20iPad%20development%20is%20going%20to%20be%20the%20next%20big%20thing%20for%20the%20computing%20ecosystem.%20There%20are%20several%20reasons%20for%20this.%203%20years%20ago%2C%20when%20iPhone%20was%20launched%2C%20Apple%20targeted%20the%20so%20called%20%22busy%22%20users%20%28no%20not%20me%29.%20Most%20of%20these%20users%2C%20use%20" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/&amp;title=Random+Thoughts+on+iPad" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<p>&copy;2010 <a href="http://blog.mugunthkumar.com">MK Blog</a>. All Rights Reserved.</p>.

<p>Related posts:<ol><li><a href='http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/' rel='bookmark' title='Permanent Link: Save As vs Exporting &#8211; Why Apple excels at UI Design?'>Save As vs Exporting &#8211; Why Apple excels at UI Design?</a> <small>Most users think, Mac UI is all about slick graphics...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/qc4sFgmF4oisA0qTFoVp1BY6zcg/0/da"><img src="http://feedads.g.doubleclick.net/~a/qc4sFgmF4oisA0qTFoVp1BY6zcg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qc4sFgmF4oisA0qTFoVp1BY6zcg/1/da"><img src="http://feedads.g.doubleclick.net/~a/qc4sFgmF4oisA0qTFoVp1BY6zcg/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/</feedburner:origLink></item>
	</channel>
</rss>
