<?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, 29 Jun 2010 06:15:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</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>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/consuming-a-restful-service-bit-ly-in-an-iphone-application/' rel='bookmark' title='Permanent Link: Consuming a RESTful Service (bit.ly) in an iPhone Application'>Consuming a RESTful Service (bit.ly) in an iPhone Application</a> <small>bit-ly-rest-api-objective-c Introduction Of late, many programmers who develop for Windows/Linux...</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/consuming-a-restful-service-bit-ly-in-an-iphone-application/' rel='bookmark' title='Permanent Link: Consuming a RESTful Service (bit.ly) in an iPhone Application'>Consuming a RESTful Service (bit.ly) in an iPhone Application</a> <small>bit-ly-rest-api-objective-c Introduction Of late, many programmers who develop for Windows/Linux...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/43r74o7ZROovKOvV98eklox_4wI/0/da"><img src="http://feedads.g.doubleclick.net/~a/43r74o7ZROovKOvV98eklox_4wI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/43r74o7ZROovKOvV98eklox_4wI/1/da"><img src="http://feedads.g.doubleclick.net/~a/43r74o7ZROovKOvV98eklox_4wI/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>1</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-uisearchdisplaycontroller-with-nspredicate/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate'>iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate</a> <small>Though UISearchDisplayController is seemingly easy (and yes it&#8217;s easy), apart...</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-uisearchdisplaycontroller-with-nspredicate/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate'>iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate</a> <small>Though UISearchDisplayController is seemingly easy (and yes it&#8217;s easy), apart...</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/aQaHL61kWfdj--R_JPf7w2jZ5_E/0/da"><img src="http://feedads.g.doubleclick.net/~a/aQaHL61kWfdj--R_JPf7w2jZ5_E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/aQaHL61kWfdj--R_JPf7w2jZ5_E/1/da"><img src="http://feedads.g.doubleclick.net/~a/aQaHL61kWfdj--R_JPf7w2jZ5_E/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>6</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>
<li><a href='http://blog.mugunthkumar.com/articles/elements-of-usability-design-okcancel-vs-cancelok-is-it-just-a-matter-of-taste/' rel='bookmark' title='Permanent Link: Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?'>Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?</a> <small>OK, many of the programmers would have been confused as...</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>
<li><a href='http://blog.mugunthkumar.com/articles/elements-of-usability-design-okcancel-vs-cancelok-is-it-just-a-matter-of-taste/' rel='bookmark' title='Permanent Link: Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?'>Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?</a> <small>OK, many of the programmers would have been confused as...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/LO0IVtL6w4SWEg16ze1It0Wv8-o/0/da"><img src="http://feedads.g.doubleclick.net/~a/LO0IVtL6w4SWEg16ze1It0Wv8-o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LO0IVtL6w4SWEg16ze1It0Wv8-o/1/da"><img src="http://feedads.g.doubleclick.net/~a/LO0IVtL6w4SWEg16ze1It0Wv8-o/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>0</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/articles/random-thoughts-on-ipad/</feedburner:origLink></item>
		<item>
		<title>iPhone Tutorial: Elegant way to send formatted In-App email</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/ArqMbDS1Ri0/</link>
		<comments>http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 06:14:08 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[clean-code]]></category>
		<category><![CDATA[how-to]]></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=705</guid>
		<description><![CDATA[By now, most of you know how to send emails using the Message UI framework without quitting the app. In this tutorial, we will briefly discuss the techniques for sending a HTML formatted email with user generated content. Though sending a HTML formatted email is as easy as setting the option to HTML &#91;picker setMessageBody:emailBody [...]


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-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>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate'>iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate</a> <small>Though UISearchDisplayController is seemingly easy (and yes it&#8217;s easy), apart...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>By now, most of you know <a href="http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/">how to send emails using the Message UI framework</a> without quitting the app. In  this tutorial, we will briefly discuss the techniques for sending a HTML formatted email with user generated content. Though sending a HTML formatted email is as easy as setting the option to HTML</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span>picker setMessageBody<span style="color: #002200;">:</span>emailBody isHTML<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>There are some cases that this method that this method doesn&#8217;t take care of. In short, this method works great for sending &#8220;Tell a friend about this app&#8221; email. But if your app needs much more sophistication, especially, if it needs to email data created by the user, you can follow the approach I suggest. Using this method, you can also adapt your code for International support and send the same email in multiple languages without any &#8220;<a href="http://en.wikipedia.org/wiki/Hard_coding">hard-coding</a>&#8221;</p>
<p>Though the method promises some great features, it is ridiculously simple. <img src='http://blog.mugunthkumar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Step 1:</h2>
<p>Create a HTML File with the contents of your email and add it to your project. You should <strong>NOT </strong>create any css or link it to any external CSS files. All your styles whether embedded withing the &lt;STYLE&gt; tag or kept as a separate CSS file will mostly be stripped by email clients. The reason could be because email clients don&#8217;t want your CSS to mess around with their client CSS. Read <a href="http://css-discuss.incutio.com/?page=StyleInEmail">this</a> article for more details. A sample is given below.</p>
<h2>Step 2:</h2>
<p>Insert placeholder markers within your HTML file. Your HTML file should look something like this.<br />
<code><br />
&lt;font size = '1' color= "#222222" style = "font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial;"&gt;&lt;i&gt;<strong>//TEXT_PLACEHOLDER//</strong>&lt;/i&gt;&lt;/font&gt;<br />
&lt;font size = '2' color= "#000000" style = "font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial;"&gt; Have a great day! &lt;br/&gt;<strong>//FRIENDNAME_PLACEHOLDER// </strong>&lt;br/&gt;&lt;/font&gt;<br />
</code><br />
The bold markers are the placeholders. You can assume them to be variables in the email. We will be replacing them later.</p>
<h2>Step 3:</h2>
<p>Do exactly the same steps for sending an in app email explained in one of my <a href="http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/"> previous tutorial</a>, but rather than hardcoding the email body like this,</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>emailBody <span style="color: #002200;">=</span>
<span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%@<span style="color: #2400d9;">\n</span><span style="color: #2400d9;">\n</span>
Sent from &lt;a href=&quot;</span><span style="color: #002200;">%</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&gt;MyGreatApp&lt;/a&gt; on iPhone. &lt;a href=&quot;</span><span style="color: #002200;">%</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&gt;Download&lt;/a&gt; yours from AppStore now!
&quot;</span>, content, pageLink, iTunesLink<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Read it from your HTML File you created in Step 2.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>langString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>userDefaults dictionaryRepresentation<span style="color: #002200;">&#93;</span> objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;NSLocaleCode&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>emailFileName <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;email_%@.html&quot;</span>, langString<span style="color: #002200;">&#93;</span>;
<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>emailFilePath <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span> resourcePath<span style="color: #002200;">&#93;</span> stringByAppendingPathComponent<span style="color: #002200;">:</span> emailFileName<span style="color: #002200;">&#93;</span>;
<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>body <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithContentsOfFile<span style="color: #002200;">:</span>emailFilePath encoding<span style="color: #002200;">:</span>NSUTF8StringEncoding error<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Note that, I&#8217;m appending the locale code with the email filename. That means you should create your email file by name email_en_US.html and similarly for other language files. </p>
<h2>Step 4:</h2>
<p>Replace placeholder texts with your contents generated within the app.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">body <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>body stringByReplacingOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;//TEXT_PLACEHOLDER//&quot;</span> withString<span style="color: #002200;">:</span>myText<span style="color: #002200;">&#93;</span>;
body <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>body stringByReplacingOccurrencesOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;//FRIENDNAME_PLACEHOLDER//&quot;</span> withString<span style="color: #002200;">:</span>myFriendName<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>The values myText and myFriendName should be passed to this email function.</p>
<p>With this architecture in place, you can format your email, change language and do a lot more without much changes to your code. After all, writing cleaner code is more important in the long run.</p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_705_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/705?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_705_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=705&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fiphone-tutorial-elegant-way-to-send-formatted-in-app-email%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+Elegant+way+to+send+formatted+In-App+email+-+http://mk.sg/6e&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-elegant-way-to-send-formatted-in-app-email/&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-elegant-way-to-send-formatted-in-app-email/&amp;title=iPhone+Tutorial%3A+Elegant+way+to+send+formatted+In-App+email&amp;srcUrl=http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/&amp;srcTitle=iPhone+Tutorial%3A+Elegant+way+to+send+formatted+In-App+email&amp;snippet=By%20now%2C%20most%20of%20you%20know%20how%20to%20send%20emails%20using%20the%20Message%20UI%20framework%20without%20quitting%20the%20app.%20In%20%20this%20tutorial%2C%20we%20will%20briefly%20discuss%20the%20techniques%20for%20sending%20a%20HTML%20formatted%20email%20with%20user%20generated%20content.%20Though%20sending%20a%20HTML%20formatted%20email%20is%20as%20easy%20as%20setting%20the%20option%20to%20HTM" 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-elegant-way-to-send-formatted-in-app-email/&amp;title=iPhone+Tutorial%3A+Elegant+way+to+send+formatted+In-App+email" 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-elegant-way-to-send-formatted-in-app-email/&amp;t=iPhone+Tutorial%3A+Elegant+way+to+send+formatted+In-App+email" 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+Elegant+way+to+send+formatted+In-App+email&amp;link=http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/" 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+Elegant+way+to+send+formatted+In-App+email&amp;body=Link: http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A By%20now%2C%20most%20of%20you%20know%20how%20to%20send%20emails%20using%20the%20Message%20UI%20framework%20without%20quitting%20the%20app.%20In%20%20this%20tutorial%2C%20we%20will%20briefly%20discuss%20the%20techniques%20for%20sending%20a%20HTML%20formatted%20email%20with%20user%20generated%20content.%20Though%20sending%20a%20HTML%20formatted%20email%20is%20as%20easy%20as%20setting%20the%20option%20to%20HTM" 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-elegant-way-to-send-formatted-in-app-email/&amp;title=iPhone+Tutorial%3A+Elegant+way+to+send+formatted+In-App+email" 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-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>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate'>iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate</a> <small>Though UISearchDisplayController is seemingly easy (and yes it&#8217;s easy), apart...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/4kXwUAB7QxDBAGb-iiwpg5-ulsE/0/da"><img src="http://feedads.g.doubleclick.net/~a/4kXwUAB7QxDBAGb-iiwpg5-ulsE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4kXwUAB7QxDBAGb-iiwpg5-ulsE/1/da"><img src="http://feedads.g.doubleclick.net/~a/4kXwUAB7QxDBAGb-iiwpg5-ulsE/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/iphone-tutorial-elegant-way-to-send-formatted-in-app-email/</feedburner:origLink></item>
		<item>
		<title>How to deploy on iPhone OS 3.1.3 without downloading the 2GB SDK</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/Dsn7Ha_1PlE/</link>
		<comments>http://blog.mugunthkumar.com/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 12:51:49 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[iphone dev]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips n tricks]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=698</guid>
		<description><![CDATA[Like most of you, I too downloaded the 3.2 beta and was playing around with some iPad stuff. Today when iPhone OS 3.1.3 is released, without second thought, I immediately updated my iPhone. My iPhone being a development device, I understood that I can no longer use the current XCode installation to run apps on [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Like most of you, I too downloaded the 3.2 beta and was playing around with some iPad stuff. Today when iPhone OS 3.1.3 is released, without second thought, I immediately updated my iPhone. My iPhone being a development device, I understood that I can no longer use the current XCode installation to run apps on device. When I launched XCode, the Organizer reported,</p>
<p>&#8220;The version of iPhone OS on “ABC’s iPhone” does not match any of the versions of iPhone OS supported for development with this installation of the iPhone SDK&#8221;</p>
<p>So does that mean, you should re-install the SDK? Just like me, you will probably have confusions like,</p>
<blockquote><p>Will installing it corrupt or overwrite your 3.2 beta?</p>
<p>Should I re-install 3.2 beta again?</p></blockquote>
<p>I too had these. Fortunately, I decided to hack things myself and got the 3.1.3 working without downloading the entire SDK. This is how I did. Type the following command into your terminal.</p>
<p><code><br />
ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.2\ \(7D11\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3<br />
</code></p>
<p>Now quit and restart XCode. Voila! you have effectively &#8220;fooled&#8221; XCode! and you have saved countless hours which you can effectively use on programming another cool app!</p>
<p>Note that this hack will work *any* minor OS updates. However, if you are using a feature specific to the new version you will probably find yourself in trouble. In other words, don&#8217;t try to apply the same technique when 3.2 or 4.0 launches. </p>
<p>&#8211;<br />
Mugunth</p>
<p><map name='google_ad_map_698_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/698?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_698_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=698&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Ftech%2Fhow-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk%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=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK+-+http://mk.sg/5m&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/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/&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/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/&amp;title=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK&amp;srcUrl=http://blog.mugunthkumar.com/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/&amp;srcTitle=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK&amp;snippet=Like%20most%20of%20you%2C%20I%20too%20downloaded%20the%203.2%20beta%20and%20was%20playing%20around%20with%20some%20iPad%20stuff.%20Today%20when%20iPhone%20OS%203.1.3%20is%20released%2C%20without%20second%20thought%2C%20I%20immediately%20updated%20my%20iPhone.%20My%20iPhone%20being%20a%20development%20device%2C%20I%20understood%20that%20I%20can%20no%20longer%20use%20the%20current%20XCode%20installation%20to%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/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/&amp;title=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK" 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/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/&amp;t=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK" 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=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK&amp;link=http://blog.mugunthkumar.com/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/" 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=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK&amp;body=Link: http://blog.mugunthkumar.com/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Like%20most%20of%20you%2C%20I%20too%20downloaded%20the%203.2%20beta%20and%20was%20playing%20around%20with%20some%20iPad%20stuff.%20Today%20when%20iPhone%20OS%203.1.3%20is%20released%2C%20without%20second%20thought%2C%20I%20immediately%20updated%20my%20iPhone.%20My%20iPhone%20being%20a%20development%20device%2C%20I%20understood%20that%20I%20can%20no%20longer%20use%20the%20current%20XCode%20installation%20to%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/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/&amp;title=How+to+deploy+on+iPhone+OS+3.1.3+without+downloading+the+2GB+SDK" 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/YxAPvdYh6WO0jyaiWsHHHkjfF7s/0/da"><img src="http://feedads.g.doubleclick.net/~a/YxAPvdYh6WO0jyaiWsHHHkjfF7s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YxAPvdYh6WO0jyaiWsHHHkjfF7s/1/da"><img src="http://feedads.g.doubleclick.net/~a/YxAPvdYh6WO0jyaiWsHHHkjfF7s/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/tech/how-to-deploy-on-iphone-os-3-1-3-without-downloading-the-2gb-sdk/</feedburner:origLink></item>
		<item>
		<title>Save As vs Exporting – Why Apple excels at UI Design?</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/5qqSJ4siU3w/</link>
		<comments>http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 16:01:15 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[ui-design]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=685</guid>
		<description><![CDATA[Most users think, Mac UI is all about slick graphics and &#8220;cool&#8221; icons. Well, that might be true partially, but user interface design isn&#8217;t about photoshopping or designing cool looking icons. According to Jakob Nielsen, aesthetics is just one aspect of usability. There is much more to user friendly software than just the &#8220;cool factor&#8221; [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/articles/elements-of-usability-design-okcancel-vs-cancelok-is-it-just-a-matter-of-taste/' rel='bookmark' title='Permanent Link: Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?'>Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?</a> <small>OK, many of the programmers would have been confused as...</small></li>
<li><a href='http://blog.mugunthkumar.com/articles/usability-analysis-office-2010-on-windows-7/' rel='bookmark' title='Permanent Link: Usability Analysis &#8211; Office 2010 on Windows 7'>Usability Analysis &#8211; Office 2010 on Windows 7</a> <small>If you were following my tweets, you might be knowing...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Most users think, Mac UI is all about slick graphics and &#8220;cool&#8221; icons. Well, that might be true partially, but user interface design isn&#8217;t about photoshopping or designing cool looking icons. <a href="http://www.useit.com/papers/heuristic/heuristic_list.html">According to Jakob Nielsen</a>, aesthetics is just one aspect of usability. There is much more to user friendly software than just the &#8220;cool factor&#8221; or great icons.</p>
<p>Recently, I was using Microsoft&#8217;s Excel to edit a dozen large  CSV files. As a matter of fact, in Excel,  whenever you save &#8220;anything&#8221; you do as a CSV,  you will practically lose out features that aren&#8217;t supported natively by the underlying file format. For Example, CSV doesn&#8217;t support coloured cells. So when you colour a cell, and try to &#8220;save&#8221; it as a CSV, Excel pops up this dialog.</p>
<div id="attachment_688" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.mugunthkumar.com/wp-content/uploads/save-csv-2.png"><img class="size-medium wp-image-688" title="Saving as CSV loses of &quot;certain&quot; features" src="http://blog.mugunthkumar.com/wp-content/uploads/save-csv-2-300x65.png" alt="" width="300" height="65" /></a><p class="wp-caption-text">Saving as CSV loses of &quot;certain&quot; features</p></div>
<p>When you click &#8220;Yes&#8221;, all that Excel does is to &#8220;export&#8221; whatever content your file has into what the underlying format can support. So since, excel supports coloured cells but CSV doesn&#8217;t it ignores your colouring and proceeds saving it to CSV. Excel even goes one step far and doesn&#8217;t clear the &#8220;dirty flag&#8221; because, Excel hasn&#8217;t saved *every* change you made into the CSV.</p>
<p style="text-align: center;">
<p>Sounds good so far. But what&#8217;s really wrong here? The real problem is, Excel gives you a sense of feel that &#8220;everything&#8221; have been saved and you are safe. Things become bad when you quit Excel. Because the dirty flag isn&#8217;t cleared and the file haven&#8217;t been saved completely, Excel prompts you to &#8220;save&#8221; the file again. Specious, not wanting to take chances, some users like me, save the file again. Again the same thing happens and the end user is still just dumbfounded and asks, But, why the heck should I save it again?</p>
<p style="text-align: left;">Microsoft UI designers have failed to understand the end users. In this case, it&#8217;s because Excel fails to speak the users&#8217; lingo. According to the user, when he &#8220;saves&#8221; a file, he saves a copy and he is contended that he can always re-open when something bad happens. But excel just &#8220;exports&#8221; the file into CSV format and tells the user that it &#8220;saved&#8221; the file (when it in fact didn&#8217;t). As a result what happens is data loss. No not just cell colours, in cases, when the users doesn&#8217;t know that CSV doesn&#8217;t support multiple sheets, excel doesn&#8217;t export (or save) the second sheets data and the user just loses the entire content from the second sheet. Disaster! In one of the cases where I work, a co-worker of mine, has got used to these prompts which Excel shows after you &#8220;save&#8221; your file as CSV</p>
<div id="attachment_687" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.mugunthkumar.com/wp-content/uploads/save-csv.png"><img class="size-medium wp-image-687" title="Prompts user to save the &quot;saved&quot; file again" src="http://blog.mugunthkumar.com/wp-content/uploads/save-csv-300x114.png" alt="" width="300" height="114" /></a><p class="wp-caption-text">Prompts user to save the &quot;saved&quot; file again</p></div>
<p>and he just closes Excel assuming that these prompts are nothing but &#8220;bugs&#8221; in Excel. (Yeah see, he is a half techie and a little knowledge is dangerous.) Things went fine when he didn&#8217;t lose data, but just lost some formatting here and there. But the real disaster happened when his second sheet containing over 1000 lines and 3 hour work was lost.</p>
<p>Now, lets&#8217; see how Numbers, the equivalent software from Apple handles this.</p>
<p style="text-align: center;"><a href="http://blog.mugunthkumar.com/wp-content/uploads/numbers-save-as.png"><img class="aligncenter size-medium wp-image-693" title="Save As panel for Numbers.app" src="http://blog.mugunthkumar.com/wp-content/uploads/numbers-save-as-300x227.png" alt="Save As panel for Numbers.app" width="300" height="227" /></a></p>
<p>Apple doesn&#8217;t even include CSV or other &#8220;lossy&#8221; formats in the save as sheet. That doesn&#8217;t mean, Numbers can&#8217;t &#8220;save&#8221; your data as CSV. But rather Apple calls it as &#8220;Export&#8221;. Files you export as CSV aren&#8217;t yet saved. So, when the user quit Numbers, and get a prompt to save the document, he will not confused.</p>
<p>Because Microsoft does it this way (wrong way), other software makers like Adobe too make the same mistake. Photoshop &#8220;saves&#8221; a file as PNG and still give you a sense of feel that you have saved the file. Another such example is audacity and paint.net and even those &#8220;save as PDF&#8221; plugins. They actually don&#8217;t &#8220;save&#8221; your data, but rather export it. Apple gets it right, but the whole world gets it wrong, Unfortunate!.</p>
<p><map name='google_ad_map_685_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/685?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_685_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=685&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Farticles%2Fsave-as-vs-exporting-why-apple-excels-at-ui-design%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=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F+-+http://mk.sg/4w&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/save-as-vs-exporting-why-apple-excels-at-ui-design/&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/save-as-vs-exporting-why-apple-excels-at-ui-design/&amp;title=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F&amp;srcUrl=http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/&amp;srcTitle=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F&amp;snippet=Most%20users%20think%2C%20Mac%20UI%20is%20all%20about%20slick%20graphics%20and%20%22cool%22%20icons.%20Well%2C%20that%20might%20be%20true%20partially%2C%20but%20user%20interface%20design%20isn%27t%20about%20photoshopping%20or%20designing%20cool%20looking%20icons.%20According%20to%20Jakob%20Nielsen%2C%20aesthetics%20is%20just%20one%20aspect%20of%20usability.%20There%20is%20much%20more%20to%20user%20friendly%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/save-as-vs-exporting-why-apple-excels-at-ui-design/&amp;title=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F" 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/save-as-vs-exporting-why-apple-excels-at-ui-design/&amp;t=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F" 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=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F&amp;link=http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/" 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=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F&amp;body=Link: http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Most%20users%20think%2C%20Mac%20UI%20is%20all%20about%20slick%20graphics%20and%20%22cool%22%20icons.%20Well%2C%20that%20might%20be%20true%20partially%2C%20but%20user%20interface%20design%20isn%27t%20about%20photoshopping%20or%20designing%20cool%20looking%20icons.%20According%20to%20Jakob%20Nielsen%2C%20aesthetics%20is%20just%20one%20aspect%20of%20usability.%20There%20is%20much%20more%20to%20user%20friendly%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/save-as-vs-exporting-why-apple-excels-at-ui-design/&amp;title=Save+As+vs+Exporting+-+Why+Apple+excels+at+UI+Design%3F" 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/elements-of-usability-design-okcancel-vs-cancelok-is-it-just-a-matter-of-taste/' rel='bookmark' title='Permanent Link: Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?'>Elements of Usability Design: OK/Cancel vs Cancel/OK &#8211; Is it just a matter of taste?</a> <small>OK, many of the programmers would have been confused as...</small></li>
<li><a href='http://blog.mugunthkumar.com/articles/usability-analysis-office-2010-on-windows-7/' rel='bookmark' title='Permanent Link: Usability Analysis &#8211; Office 2010 on Windows 7'>Usability Analysis &#8211; Office 2010 on Windows 7</a> <small>If you were following my tweets, you might be knowing...</small></li>
</ol></p>
<p><a href="http://feedads.g.doubleclick.net/~a/6kDX3vdsXRTXgUJ05vABKzh5-o0/0/da"><img src="http://feedads.g.doubleclick.net/~a/6kDX3vdsXRTXgUJ05vABKzh5-o0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/6kDX3vdsXRTXgUJ05vABKzh5-o0/1/da"><img src="http://feedads.g.doubleclick.net/~a/6kDX3vdsXRTXgUJ05vABKzh5-o0/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/articles/save-as-vs-exporting-why-apple-excels-at-ui-design/</feedburner:origLink></item>
		<item>
		<title>iPhone Tutorial: Follow Cost API and a open source wrapper</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/na7M0JQN5Lc/</link>
		<comments>http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 15:31:45 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[how-to]]></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=669</guid>
		<description><![CDATA[What is Follow Cost? Follow Cost is a interesting and powerful statistic that helps you check the &#8220;cost&#8221; you would incur by &#8220;following&#8221; a person on twitter. This is a very useful statistic that I think every twitter client should adopt.  Tweetie for iPhone was the first to implement follow cost and I use this [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/consuming-a-restful-service-bit-ly-in-an-iphone-application/' rel='bookmark' title='Permanent Link: Consuming a RESTful Service (bit.ly) in an iPhone Application'>Consuming a RESTful Service (bit.ly) in an iPhone Application</a> <small>bit-ly-rest-api-objective-c Introduction Of late, many programmers who develop for Windows/Linux...</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-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[<h2>What is Follow Cost?</h2>
<p><a href="http://followcost.com">Follow Cost</a> is a interesting and powerful statistic that helps you check the &#8220;cost&#8221; you would incur by &#8220;following&#8221; a person on twitter. This is a very useful statistic that I think every twitter client should adopt.  <a href="http://www.atebits.com/tweetie-iphone">Tweetie for iPhone</a> was the first to implement follow cost and I use this feature of tweetie to check whether a follower is &#8220;worth the pain&#8221; (as follow cost puts it).</p>
<p>In short, Follow Cost gives you an approximate count of the number of updates a person tweets in a day. As a thumb rule, I don&#8217;t follow anyone with a follow cost of over 40. A celebrity with a high follow cost is <a href="http://twitter.com/guykawasaki">@guykawasaki</a>. (80+ at the time of this writing) His tweets are interesting, but is it worth the pain? Depends. To me, definitely not.</p>
<h2>The API</h2>
<p>Follow Cost has a <a href="http://followcost.com/about/api">relatively simple API</a>. But unfortunately, even after 3 months of Tweetie 2 launch, no other twitter client has implemented. You just have to make a GET request to followcost.com server with the twitter username as follows.<code>=<br />
</code></p>
<blockquote><p>http://followcost.com/<em><strong>&lt;username&gt;</strong></em>.json</p></blockquote>
<p>The resulting output is a json formatted string which can be parsed using any <a href="http://code.google.com/p/json-framework/">JSON Framework</a>.</p>
<h2>Objective C Code</h2>
<p>To make life easier, I wrote a helper class MKFollowCost. To use the class, first download the JSON framework and follow their <a href="http://code.google.com/p/json-framework/wiki/InstallationInstructions">installation instructions</a>. If you are writing a twitter client, chances are that, you would probably have done this. Download the code from below and drag the two files, MKFollowCost.h and MKFollowCost.m into your project.</p>
<p>You can instantiate a followcost object by<br />
<code>MKFollowCost *followCost = [[MKFollowCost alloc] initWithTwitterName:@"mugunthkumar"];</code><br />
All of the variables like, milliscobles, tweets per day etc, can be accessed from this object. The object is designed to be embedded without your Twitter Profile object.</p>
<h2>Downloads</h2>
<p>FollowCost Objective C Wrapper: <a href="http://blog.mugunthkumar.com/wp-content/uploads/FollowCost-v1.0.zip">FollowCost v1.0</a></p>
<h3>Rights</h3>
<p>You can use it in your own Twitter client, royalty free. Attributing me is upto you. However, if you modify the source code, please make it open source.</p>
<p><map name='google_ad_map_669_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/669?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_669_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=669&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fiphone-tutorial-follow-cost-api-and-a-open-source-wrapper%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+Follow+Cost+API+and+a+open+source+wrapper+-+http://mk.sg/4j&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-follow-cost-api-and-a-open-source-wrapper/&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-follow-cost-api-and-a-open-source-wrapper/&amp;title=iPhone+Tutorial%3A+Follow+Cost+API+and+a+open+source+wrapper&amp;srcUrl=http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/&amp;srcTitle=iPhone+Tutorial%3A+Follow+Cost+API+and+a+open+source+wrapper&amp;snippet=What%20is%20Follow%20Cost%3F%0D%0AFollow%20Cost%20is%20a%20interesting%20and%20powerful%20statistic%20that%20helps%20you%20check%20the%20%22cost%22%20you%20would%20incur%20by%20%22following%22%20a%20person%20on%20twitter.%20This%20is%20a%20very%20useful%20statistic%20that%20I%20think%20every%20twitter%20client%20should%20adopt.%C2%A0%20Tweetie%20for%20iPhone%20was%20the%20first%20to%20implement%20follow%20cost%20an" 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-follow-cost-api-and-a-open-source-wrapper/&amp;title=iPhone+Tutorial%3A+Follow+Cost+API+and+a+open+source+wrapper" 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-follow-cost-api-and-a-open-source-wrapper/&amp;t=iPhone+Tutorial%3A+Follow+Cost+API+and+a+open+source+wrapper" 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+Follow+Cost+API+and+a+open+source+wrapper&amp;link=http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/" 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+Follow+Cost+API+and+a+open+source+wrapper&amp;body=Link: http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A What%20is%20Follow%20Cost%3F%0D%0AFollow%20Cost%20is%20a%20interesting%20and%20powerful%20statistic%20that%20helps%20you%20check%20the%20%22cost%22%20you%20would%20incur%20by%20%22following%22%20a%20person%20on%20twitter.%20This%20is%20a%20very%20useful%20statistic%20that%20I%20think%20every%20twitter%20client%20should%20adopt.%C2%A0%20Tweetie%20for%20iPhone%20was%20the%20first%20to%20implement%20follow%20cost%20an" 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-follow-cost-api-and-a-open-source-wrapper/&amp;title=iPhone+Tutorial%3A+Follow+Cost+API+and+a+open+source+wrapper" 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/consuming-a-restful-service-bit-ly-in-an-iphone-application/' rel='bookmark' title='Permanent Link: Consuming a RESTful Service (bit.ly) in an iPhone Application'>Consuming a RESTful Service (bit.ly) in an iPhone Application</a> <small>bit-ly-rest-api-objective-c Introduction Of late, many programmers who develop for Windows/Linux...</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-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/rIZqpvO1T5DwinNPnlAi3syHIxA/0/da"><img src="http://feedads.g.doubleclick.net/~a/rIZqpvO1T5DwinNPnlAi3syHIxA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rIZqpvO1T5DwinNPnlAi3syHIxA/1/da"><img src="http://feedads.g.doubleclick.net/~a/rIZqpvO1T5DwinNPnlAi3syHIxA/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/iphone-tutorial-follow-cost-api-and-a-open-source-wrapper/</feedburner:origLink></item>
		<item>
		<title>iPhone Tutorial – Enabling reviewers to use your In-App purchases for free</title>
		<link>http://feedproxy.google.com/~r/MugunthKumar/~3/lxd42qFHQjk/</link>
		<comments>http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 15:48:29 +0000</pubDate>
		<dc:creator>Mugunth Kumar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[iphone dev]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=559</guid>
		<description><![CDATA[In-App purchases is a great way for developers to upsell by giving away their app for free and then allow them to charge for features when users start using it. This freemium model has indeed worked very well for upselling your app in the AppStore. But unfortunately, there isn&#8217;t an Apple allowed way to allow [...]


Related posts:<ol><li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-%e2%80%93-in-app-purchases/' rel='bookmark' title='Permanent Link: iPhone Tutorial – In-App Purchases'>iPhone Tutorial – In-App Purchases</a> <small>Last week, Apple announced that in-app purchases will be available...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate'>iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate</a> <small>Though UISearchDisplayController is seemingly easy (and yes it&#8217;s easy), apart...</small></li>
<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>In-App purchases is a great way for developers to upsell by giving away their app for free and then allow them to charge for features when users start using it. This freemium model has indeed worked very well for upselling your app in the AppStore. But unfortunately, there isn&#8217;t an Apple allowed way to allow reviewers to &#8220;download&#8221; your in-app purchases for free (like giving away promotional codes for your in-app purchases). So most developers again resort to the same &#8220;lite&#8221;, &#8220;pro&#8221; model.</p>
<p>After raising the issue to Apple, I even got a official reply that it&#8217;s not possible currently to allow reviewers to use your in-app purchases for free.</p>
<p><a href="http://blog.mugunthkumar.com/wp-content/uploads/noinappurchases.png"><img class="aligncenter size-medium wp-image-566" title="noinappurchases" src="http://blog.mugunthkumar.com/wp-content/uploads/noinappurchases-300x132.png" alt="noinappurchases" width="300" height="132" /></a></p>
<p>However, developers&#8217; creativity knows no bounds. In this post, I&#8217;ll present a method to allow reviewers to use your in-app purchases for free without having multiple versions of the same app on the app store. The source code for the same is also available royalty-free (as always) for using it in your own apps. Before diving in, it&#8217;s advised that you read through my previous <a href="http://blog.mugunthkumar.com/coding/iphone-tutorial-–-in-app-purchases">tutorial on how to do in-app purchases</a></p>
<p><span id="more-559"></span></p>
<h2>Focus</h2>
<p>As I previously wrote, you can sell consumables, non-consumables and subscriptions using the in-app purchases model. This article is focussed primarily on consumables and non-consumables. However, you can extend it to subscriptions as well by adding a bit more server side PHP programming. This post however focusses on adding this feature to consumable and non-consumable items only.</p>
<h2>A Quick Recap</h2>
<p>By now, you must be knowing the flow of a in-app purchase request. If you don&#8217;t, read through my in-app purchases tutorial. As a recap,</p>
<p>1) You list the items available for sale from your store to the user.</p>
<p>2) When the user chooses a feature, you prepare a SKPayment object and add it to the queue.</p>
<p>3) Listen to notifications and record the purchases within your apps&#8217; NSUserDefaults.</p>
<p>Or it&#8217;s even more simple if you had used my MKStoreKit.</p>
<h2>The Idea</h2>
<p>The idea here is to maintain a list of device IDs on the developer server and check whether the current device is exempted to use the feature without purchasing. If the device is allowed, rather than initiating a purchase, temporarily set the variables as if the transactions were made.</p>
<p>The complete source code,  MKStoreKit V2.0 is attached at the end of the post.</p>
<p>You should be glad to know that, you don&#8217;t have to make changes to your calling code to add this feature.<br />
In MKStoreKit, there is a function called buyFeature which initiates a in-app purchase request. In version 2.0, this function is modified to make a check first to your server (server code is also attached to this post) passing the UDID of the current device. If your server responds with a YES, it activates the feature temporarily without &#8220;actually purchasing&#8221;. This will enable your reviewers to review your app without buying your in-app purchase.</p>
<p>- (BOOL) canCurrentDeviceUseFeature: (NSString*) featureID;</p>
<p>This is the function that is called. Currently it checks the server mentioned in the variable ownServer (presently set to nil). To enable this function, you have to do the server side changes as explained in the next step.</p>
<h2>Server Side Changes</h2>
<p>Setup a database with two tables setup in your server. One table for storing a list of available products and another for storing new review requests as they come in.</p>
<p>The products table has the following fields<br />
<em><strong>productid    productName    productDesc</strong></em></p>
<p>The requests table has the following fields<br />
<em><strong>udid    productid    email    message    status    lastUpdated</strong></em></p>
<p>You can use the SQL file attached to create these tables. Add a user to your MySql database and fill in the user id and password into the two php files.</p>
<p>Copy the server files from the ServerCode folder to some location like</p>
<p>http://api.mycompany.com/inapp/</p>
<p>change the &#8220;ownServer&#8221; variable in MKStoreManager.m to </p>
<p>http://api.mycompany.com/inapp/featureCheck.php</p>
<p>The featureCheck.php file checks the requests table for the UDID and the featureID. If the status of that row is 1, it returns YES. If your server returns YES for a particular UDID, the app activates the purchase for the current session without initiating a StoreKit purchase. Note that, this featureCheck happens everytime the app is started. Hence, if you deactivate a UDID on your server after the reviewer has finished reviewing, he will not be able to continue using it for free (Which means, you have actually given the reviewer a sneak-peek to your feature. Even if he likes it, he has to buy it)</p>
<h2>How to send your review request?</h2>
<p>There are atleast three ways of doing this.<br />
One way is to ask your reviewers to send the UDID to you by email. You can ask them to use the <a href="http://itunes.apple.com/us/app/ad-hoc-helper/id285691333?mt=8">Ad Hoc Helper by Erica Sadun</a> You can then manually add it into the database using the AddDevice.html (present in the Server Code folder)<br />
Second way is,  You can &#8220;pretty up&#8221; the AddDevice.html and host it somewhere in your server. Send a link to this to your reviewers for filling their UDID/Product ID.<br />
Third, as in my case, I&#8217;ve created a separate iPhone App for doing this. The only reason for doing so is, filling the UDID is very very cumbersome and error prone. If anyone knows a way to read the UDID of a device from a webapp, do let me know. (The big5 code didn&#8217;t work for me)</p>
<h2>Going forward</h2>
<p>I understand that all this server side setup is quite cumbersome. The server code isn&#8217;t even polished like the MKStoreKit. If Apple approves this method (which I will know in another 20 days), In MKStoreKit 3.0, I&#8217;ll probably throw of the whole server side code and replace it with a much elegant method by using a Google Spreadsheet. I haven&#8217;t yet digged around with the <a href="http://code.google.com/apis/spreadsheets/">spreadsheets API</a>. This way, you can implement the same feature without even owning a server <img src='http://blog.mugunthkumar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I might as well add in features to migrate your existing customers who use your pro version to the version with in-app purchases. Stay tuned!</p>
<h2>Source Code (Much awaited)</h2>
<p><a href="http://blog.mugunthkumar.com/wp-content/uploads/MKStoreKit-V2.0.zip">MKStoreKit V2.0</a><br />
If you cannot successfully use this, you can hire me to do it for you. <img src='http://blog.mugunthkumar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I usually freelance through <a href="http://www.odesk.com/community/user/10015207">oDesk.com</a></p>
<p><map name='google_ad_map_559_8b86e81420c6776e'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/559?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_559_8b86e81420c6776e' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=559&amp;url= http%3A%2F%2Fblog.mugunthkumar.com%2Fcoding%2Fiphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free%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+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free+-+http://mk.sg/31&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-enabling-reviewers-to-use-your-in-app-purchases-for-free/&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-enabling-reviewers-to-use-your-in-app-purchases-for-free/&amp;title=iPhone+Tutorial+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free&amp;srcUrl=http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/&amp;srcTitle=iPhone+Tutorial+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free&amp;snippet=In-App%20purchases%20is%20a%20great%20way%20for%20developers%20to%20upsell%20by%20giving%20away%20their%20app%20for%20free%20and%20then%20allow%20them%20to%20charge%20for%20features%20when%20users%20start%20using%20it.%20This%20freemium%20model%20has%20indeed%20worked%20very%20well%20for%20upselling%20your%20app%20in%20the%20AppStore.%20But%20unfortunately%2C%20there%20isn%27t%20an%20Apple%20allowed%20way" 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-enabling-reviewers-to-use-your-in-app-purchases-for-free/&amp;title=iPhone+Tutorial+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free" 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-enabling-reviewers-to-use-your-in-app-purchases-for-free/&amp;t=iPhone+Tutorial+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free" 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+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free&amp;link=http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/" 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+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free&amp;body=Link: http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A In-App%20purchases%20is%20a%20great%20way%20for%20developers%20to%20upsell%20by%20giving%20away%20their%20app%20for%20free%20and%20then%20allow%20them%20to%20charge%20for%20features%20when%20users%20start%20using%20it.%20This%20freemium%20model%20has%20indeed%20worked%20very%20well%20for%20upselling%20your%20app%20in%20the%20AppStore.%20But%20unfortunately%2C%20there%20isn%27t%20an%20Apple%20allowed%20way" 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-enabling-reviewers-to-use-your-in-app-purchases-for-free/&amp;title=iPhone+Tutorial+-+Enabling+reviewers+to+use+your+In-App+purchases+for+free" 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-%e2%80%93-in-app-purchases/' rel='bookmark' title='Permanent Link: iPhone Tutorial – In-App Purchases'>iPhone Tutorial – In-App Purchases</a> <small>Last week, Apple announced that in-app purchases will be available...</small></li>
<li><a href='http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/' rel='bookmark' title='Permanent Link: iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate'>iPhone Tutorial &#8211; UISearchDisplayController with NSPredicate</a> <small>Though UISearchDisplayController is seemingly easy (and yes it&#8217;s easy), apart...</small></li>
<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/jRMk9oPZjGV2ehbRrKQE94qCi0U/0/da"><img src="http://feedads.g.doubleclick.net/~a/jRMk9oPZjGV2ehbRrKQE94qCi0U/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jRMk9oPZjGV2ehbRrKQE94qCi0U/1/da"><img src="http://feedads.g.doubleclick.net/~a/jRMk9oPZjGV2ehbRrKQE94qCi0U/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		<feedburner:origLink>http://blog.mugunthkumar.com/coding/iphone-tutorial-enabling-reviewers-to-use-your-in-app-purchases-for-free/</feedburner:origLink></item>
	</channel>
</rss>
