<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iphone.mitchallen.com</title>
	<atom:link href="http://mitchallen.com/iphone/feed" rel="self" type="application/rss+xml" />
	<link>http://mitchallen.com/iphone</link>
	<description>random notes on iPhone development</description>
	<lastBuildDate>Tue, 10 Aug 2010 20:36:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Release Early, Release Often</title>
		<link>http://mitchallen.com/iphone/archives/591</link>
		<comments>http://mitchallen.com/iphone/archives/591#comments</comments>
		<pubDate>Sun, 08 Aug 2010 14:27:11 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Bolt Creative]]></category>
		<category><![CDATA[Dan Catelnuovo]]></category>
		<category><![CDATA[PocketGamer]]></category>
		<category><![CDATA[PocketGod]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=591</guid>
		<description><![CDATA[&#8220;We float around between #22 to #27 in the US charts,&#8221; says Castelnuovo. &#8220;The top #25 is good, but it&#8217;s dangerous to let it slip outside this.&#8221; As part of this drive, he expects the pace of updates to speed up, from the current six to eight weeks to every couple of weeks. &#8220;In future [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8220;We float around between #22 to #27 in the US charts,&#8221; says Castelnuovo. &#8220;The top #25 is good, but it&#8217;s dangerous to let it slip outside this.&#8221;</em></p>
<p><em>As part of this drive, he expects the pace of updates to speed up, from the current six to eight weeks to every couple of weeks.</em></p>
<p><em>&#8220;In future we&#8217;re going to be focusing on adding smaller amounts of content such as new powers and mini-games,&#8221; he says.&#8221;</em></p>
<p>- <strong><a href="http://www.pocketgamer.biz/r/PG%2EBiz/Bolt+Creative+news/news.asp?c=19075">GDC 2010: Castelnuovo on Pocket God&#8217;s 140,000 in-app purchases (pocketgamer.biz)</a></strong></p>
<hr size="1" />If you&#8217;ve read my previous post on <a href="http://mitchallen.com/iphone/archives/588"><strong>Continuous Integration</strong></a>, or the article in my Android blog on <strong><a title="Getting to 1.0" href="http://mitchallen.com/android/archives/68">Getting to 1.0</a></strong>, you know that I&#8217;m a big fan of <a title="incremental development" href="http://en.wikipedia.org/wiki/Iterative_and_incremental_development"><strong>incremental development</strong></a>.  Basically I like the idea of doing what it takes to get to 1.0 as fast as possible, then adding features in an incremental fashion later.  Apparently this strategy has worked out quite well for <strong><a href="http://www.boltcreative.com">Bolt Creative</a></strong> &#8211; the people behind <strong>PocketGod</strong>.  See the article linked to in the quote above and this article in <strong>pocketgamer.biz</strong>: <a title="After 33 updates ... (pocketgamer.biz)" href="http://www.pocketgamer.biz/r/PG%2EBiz/Pocket+God/news.asp?c=22641"><strong>After 33 updates, Pocket God breaks 3 million paid downloads barrier</strong></a>. (BTW, while you are there, you might want to search their site on &#8220;<a title="bolt creative - pocketgamer.biz" href="http://www.pocketgamer.biz/latest.asp?srch=bolt+creative"><strong>bolt creative</strong></a>&#8221; for some other interesting articles.)</p>
<p>From my own little experiment in the  Android Market I can tell you that when I would release an update I would get a bump in users.  There could be a couple of reasons for this.  One might be that Google picks up and promotes refreshed apps (I only suspect, I&#8217;m not sure &#8211; and it seemed to stop working for my last update).  They do highlight when an app has been updated  on the users phone &#8211; much the way the App Store app does on iPhones.  But that wouldn&#8217;t explain the bump in new users.</p>
<p>Of course nothing will help bump up the users more than writing a great game.  Plus you also need to think about keeping existing users.   The best way to do that is to keep refreshing your app with content and fixing any bugs that come up.  You&#8217;ll notice that I didn&#8217;t stress adding new features.  While ramping up in an incremental fashion, you will naturally need to be adding new features.  But there will come a point where you can only add so many new buttons to the screen and should switch your focus to content and bug fixes.</p>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/591/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Integration with Hudson</title>
		<link>http://mitchallen.com/iphone/archives/588</link>
		<comments>http://mitchallen.com/iphone/archives/588#comments</comments>
		<pubDate>Wed, 16 Jun 2010 12:59:28 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[source control]]></category>
		<category><![CDATA[Hudson]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=588</guid>
		<description><![CDATA[In my day job there is a heavy emphasis on building and testing software using Continuous Integration.  To quote from Martin Fowler&#8217;s site: &#8220;Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily &#8211; leading to multiple integrations per day. Each integration [...]]]></description>
			<content:encoded><![CDATA[<p>In my day job there is a heavy emphasis on building and testing software using <a href="http://martinfowler.com/articles/continuousIntegration.html">Continuous Integration</a>.  To quote from Martin Fowler&#8217;s site:</p>
<p>&#8220;<em>Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily &#8211; leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.</em>&#8221;</p>
<p>To manage the automated builds, including (smoke) testing, we use a free open source tool called <a href="http://hudson-ci.org/">Hudson</a>.   It&#8217;s written in Java, so you can run it on your Mac, Linux, Windows, etc.  You can run it as part of a server, or stand-alone.</p>
<p>I decided to look around and see if anyone was using Hudson to build iPhone and Android apps.  I found a great article that covers the process:</p>
<p><a href="http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson">How to automate your iPhone app builds with Hudson by Michael Nachbaur</a>.</p>
<p>If you&#8217;re an indie developer, you may be thinking that this doesn&#8217;t apply to you.  But think of the advantages:</p>
<ul>
<li>Tests are automatically run to see if you broke something</li>
<li>Test apps can be automatically distributed to your Web site for Beta testing</li>
<li>Wrestling with certificates, etc, can all be automated</li>
<li>Build numbers can automatically be integrated</li>
<li>Multiple build configurations can be automated</li>
<li>It forces you to think about managing your code through source control. <img src='http://mitchallen.com/iphone/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Even though I use Hudson at work and have installed a stand-alone copy on my Mac at home, I haven&#8217;t tried this yet.  But I&#8217;m thinking of buying on of those new (er, admittedly over-priced &#8230;) Mac-Mini&#8217;s in the next month or two and setting something up.</p>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/588/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[plug] Learning Cocos2D (The Simple Way)</title>
		<link>http://mitchallen.com/iphone/archives/584</link>
		<comments>http://mitchallen.com/iphone/archives/584#comments</comments>
		<pubDate>Wed, 16 Jun 2010 02:07:14 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[game engines]]></category>
		<category><![CDATA[shameless plugs]]></category>
		<category><![CDATA[Cocos2D]]></category>
		<category><![CDATA[iPhoneGameKit]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=584</guid>
		<description><![CDATA[I&#8217;ve decided to introduce a new category: shameless plugs. It&#8217;s a place where individuals or small businesses can plug their apps or software that may be of interest to readers of this blog.  First up, The iPhone Game Kit. Learning Cocos2D (The Simple Way) If you are reading Mitch&#8217;s blog, we assume you already have [...]]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;ve decided to introduce a new category: </em><strong><em>shameless plugs</em></strong><em>.  It&#8217;s a place where individuals or small businesses can plug their apps or software that may be of interest to readers of this blog.  First up, The iPhone Game Kit.</em></p>
<p><strong>Learning Cocos2D (The Simple Way)<br />
</strong><br />
If you are reading Mitch&#8217;s blog, we assume you already have a good grasp of Cocos2D. But do you remember how you took your first steps towards learning Cocos2D? Was it a simple, straightforward experience or did you have to deal with lack of resources, or other difficulties making your way into Objective-C? And how would you do it if you had to start learning all over again? These are some of the questions that Nathanael Weiss asked himself when he began working on the iPhone Game Kit. His idea? Create a simple, methodic and straightforward guide to learning Cocos2D and getting started on iPhone Game Development.</p>
<p>The iPhone Game Kit is an entry-level guide on Xcode basics, Objective-C and App Store publishing. This is not a simple drag-and-drop editor, but a comprehensive tutorial to learn iPhone game development basics using Cocos2D. The idea behind the Game kit is to lay a genuine foundation to game design, allowing users to use it as a stepping stone for larger, more complex projects.</p>
<p>Included in the Kit is the Cocos2D engine itself, a 700MB art library, the step-by-step guide and an App Publishing walkthrough. We are also featuring a tutorials section on our website, covering some of the points in the guide and extending its functionality. The Game Kit is currently available as a digital download, and you can learn more about it on <a href="http://www.iphonegamekit.com/" target="_blank">www.iPhoneGameKit.com </a></p>
<p><em>If you have an app or software that you&#8217;d like to pitch to my readers, let me know.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/584/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Particle Designer works with Cocos2D</title>
		<link>http://mitchallen.com/iphone/archives/580</link>
		<comments>http://mitchallen.com/iphone/archives/580#comments</comments>
		<pubDate>Wed, 19 May 2010 14:28:57 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[game engines]]></category>
		<category><![CDATA[71squared]]></category>
		<category><![CDATA[Cocos2D]]></category>
		<category><![CDATA[particle generator]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=580</guid>
		<description><![CDATA[There&#8217;s a new video out from 71 Squared that demos their Particle Designer. It also discusses how to use it with the latest Cocos2D game engine. The video is hosted on Vimeo &#8211; which hasn&#8217;t quite worked out HTML5 embedding. So if I embed it here, you can&#8217;t view it on an iPad or iPhone. [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a new video out from 71 Squared that demos their Particle Designer.  It also discusses how to use it with the latest Cocos2D game engine.</p>
<p><a href="http://mitchallen.com/iphone/wp-content/uploads/2010/05/Screen-shot-2010-05-19-at-7.26.30-AM1.png"><img src="http://mitchallen.com/iphone/wp-content/uploads/2010/05/Screen-shot-2010-05-19-at-7.26.30-AM1-300x195.png" alt="" title="Particle Designer Tutorial on Vimeo" width="300" height="195" class="aligncenter size-medium wp-image-582" /></a></p>
<p>The video is hosted on Vimeo &#8211; which hasn&#8217;t quite worked out HTML5 embedding.  So if I embed it here, you can&#8217;t view it on an iPad or iPhone.  But you can view the video on their site using those devices.  So here is the link:</p>
<p><a href="http://vimeo.com/11852511">http://vimeo.com/11852511</a></p>
<p>For more info, see here:</p>
<p><a href="http://particledesigner.71squared.com">http://particledesigner.71squared.com</a></p>
<p>You can download a trial and then opt to pay just under $8 for the version that emits code that can be used by the Cocos2D engine.</p>
<p>The two things that I like are the random and sharing options.  You can opt to add whatever you come up with to a public gallery of emitters.</p>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/580/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Web App with UIWebView</title>
		<link>http://mitchallen.com/iphone/archives/552</link>
		<comments>http://mitchallen.com/iphone/archives/552#comments</comments>
		<pubDate>Thu, 06 May 2010 16:04:50 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[tutorial]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[UIWebView]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=552</guid>
		<description><![CDATA[In this tutorial I&#8217;m going to show you how to build a Universal iPhone / iPad app that displays a self-contained Web site in a UIWebView component. Why would you want to do that? Well because you could then design and build entire apps with nothing more than HTML5, CSS and JavaScript. There are plenty [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I&#8217;m going to show you how to build a Universal iPhone / iPad app that displays a self-contained Web site in a UIWebView component.  Why would you want to do that?  Well because you could then design and build entire apps with nothing more than HTML5, CSS and JavaScript.  </p>
<p>There are plenty of books on building apps that work in the UIWebView &#8211; which uses the same technology behind the iPhone / iPad Safari Web browser.  I would suggest searching for online tutorials and books with the keyword &#8220;WebKit.&#8221;  You could narrow down your search by also searching on &#8220;Safari&#8221;.  </p>
<p>A good place to start is here:</p>
<p><strong><a href="http://developer.apple.com/safari/">http://developer.apple.com/safari/</a></strong></p>
<hr size="1" />
<div id="attachment_559" class="wp-caption aligncenter" style="width: 310px"><a href="http://mitchallen.com/iphone/wp-content/uploads/2010/05/Screen-shot-2010-05-06-at-9.14.01-AM.png"><img class="size-medium wp-image-559" title="iPhone Simulator running bundled Web site" src="http://mitchallen.com/iphone/wp-content/uploads/2010/05/Screen-shot-2010-05-06-at-9.14.01-AM-300x203.png" alt="" width="300" height="203" /></a><p class="wp-caption-text">Bundled Web Site</p></div>
<hr size="1" />
<p>This tutorial is not going to cover WebKit.  It&#8217;s just going to show you how to build a wrapper in Objective-C for the browser component.  The design of the Web app is up to you.  Though first, I would like to offer a few tips on writing your HTML.</p>
<p><strong>Bundled HTML Issues</strong></p>
<p>When bundling HTML to be run locally in a UIWebView, you need to consider a few issues:</p>
<ul>
<li>There is no server.  So server-side scripts like PHP will not work.  Though if your user is connected to the Internet you could always provide links to a Web site running PHP.  But the focus here is on self-contained apps.</i>
<li>Because there is no server there is nothing to interpret links like &#8220;test/&#8221; to mean &#8220;test/index.html.&#8221;  So when linking to sub-folders you need to append &#8220;/index.htm,&#8221; &#8220;index.html,&#8221; etc.</li>
<li>When copying HTML folders into your Xcode project be sure to check &#8220;Create Folder References for any added folders.&#8221;  Otherwise Xcode will bundle your files into groups and relative HTML links to sub-folders won&#8217;t work.
<li>JavaScript calls can not take too long or your script may be stopped.</li>
<li>When using the new HTML5 video tag, the iPad needs the controls attribute to be set to true (or anything which is interpreted as true).</li>
<li>The iPad will use the first frame of a video as a poster frame.  The iPhone will not and you should provide it.</li>
<li>The iPhone and iPad support SVG (Scalable Vector Graphics) &#8211; a technology that I started writing about a few years ago &#8211; but didn&#8217;t have a lot of traction.  Nice to see it making a comeback. <img src='http://mitchallen.com/iphone/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   You should look for updated tutorials.</li>
<li>If you plan to also write a wrapper for Android and use your HTML there too, keep it simple.  Their HTML5 implementation needs work.  They currently do not support SVG and the video tag didn&#8217;t work for me in their latest emulator.</li>
</ul>
<hr size="1" />
<p>Now on to the tutorial:</p>
<p><strong>Create a Project in Xcode</strong></p>
<p>1. Select: File / New Project …<br />
2. Select: [ iPhone OS / Applications ] / Window-based Application<br />
3. Select: Product: Universal<br />
4. Click: Choose<br />
5. Name your project (I named this one TestWebApp01)<br />
6. Click: Save</p>
<p><strong>Create a simple Web Site</strong></p>
<p>It is important that you create your initial Web site outside of Xcode.</p>
<p>1. Create a folder somewhere called &#8220;www&#8221;<br />
2. Create an index.html file with this content.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; 
	&quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
&lt;html&gt;
  &lt;head&gt;
	&lt;!-- Change this if you want to allow scaling --&gt;
    &lt;meta name=&quot;viewport&quot; 
		content=&quot;width=default-width; user-scalable=no&quot; /&gt;
&nbsp;
    &lt;meta http-equiv=&quot;Content-type&quot; 
		content=&quot;text/html; charset=utf-8&quot;&gt;
&nbsp;
    &lt;title&gt;Web App Demo&lt;/title&gt;
&nbsp;
  &lt;/head&gt;
  &lt;body&gt;
	&lt;h1&gt;Test&lt;/h1&gt;
	&lt;p&gt;This is a test.&lt;/p&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>3. Back in Xcode expand the Shared folder<br />
4. Right-click and select: Add / Existing Files …<br />
5. Navigate to the &#8220;www&#8221; folder and click Add.<br />
6. Check: Copy items into destination group&#8217;s folder (if needed)<br />
7. IMPORTANT: Select: Create Folder References for any added folders</p>
<p><strong>Create the App</strong></p>
<p>1.  Modify iPad / AppDelegate_Pad.h so that it looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import </span>
&nbsp;
<span style="color: #a61390;">@interface</span> AppDelegate_Pad <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span>  <span style="color: #002200;">&#123;</span>
    UIWindow <span style="color: #002200;">*</span>window;
    UIWebView <span style="color: #002200;">*</span>webView;	<span style="color: #11740a; font-style: italic;">// Add UIWebView and outlet below</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIWindow <span style="color: #002200;">*</span>window;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIWebView <span style="color: #002200;">*</span>webView;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>2.  Modify iPhone / AppDelegate_Phone.h so that it looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import </span>
&nbsp;
<span style="color: #a61390;">@interface</span> AppDelegate_Phone <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span>  <span style="color: #002200;">&#123;</span>
    UIWindow <span style="color: #002200;">*</span>window;
    UIWebView <span style="color: #002200;">*</span>webView;	<span style="color: #11740a; font-style: italic;">// Add UIWebView and outlet below</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIWindow <span style="color: #002200;">*</span>window;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIWebView <span style="color: #002200;">*</span>webView;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>3.  Make the following changes to AppDelegate_Pad.m</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;AppDelegate_Pad.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> AppDelegate_Pad
&nbsp;
<span style="color: #a61390;">@synthesize</span> window;
&nbsp;
<span style="color: #a61390;">@synthesize</span> webView;		<span style="color: #11740a; font-style: italic;">// Synthesize webView</span>
&nbsp;
<span style="color: #6e371a;">#define WWW_ROOT	@&quot;www&quot;	// Define the root of the Web folder</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>application<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application
	didFinishLaunchingWithOptions<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>launchOptions <span style="color: #002200;">&#123;</span>    
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Add code to open bundled Web site</span>
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>path <span style="color: #002200;">=</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>
					  pathForResource<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;index&quot;</span>
					  ofType<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;html&quot;</span>
					  inDirectory<span style="color: #002200;">:</span>WWW_ROOT <span style="color: #002200;">&#93;</span>; 
&nbsp;
	<span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>url <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> fileURLWithPath<span style="color: #002200;">:</span>path<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSURLRequest</span> <span style="color: #002200;">*</span>request <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLRequest</span> requestWithURL<span style="color: #002200;">:</span>url<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>webView loadRequest<span style="color: #002200;">:</span>request<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Override point for customization after application launch</span>
&nbsp;
    <span style="color: #002200;">&#91;</span>window makeKeyAndVisible<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">return</span> <span style="color: #a61390;">YES</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>4. Make the following changed to AppDelegate_Phone.m</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;AppDelegate_Phone.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> AppDelegate_Phone
&nbsp;
<span style="color: #a61390;">@synthesize</span> window;
&nbsp;
<span style="color: #a61390;">@synthesize</span> webView;		<span style="color: #11740a; font-style: italic;">// Synthesize webView</span>
&nbsp;
<span style="color: #6e371a;">#define WWW_ROOT	@&quot;www&quot;	// Define the root of the Web folder</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>application<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application
	didFinishLaunchingWithOptions<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>launchOptions <span style="color: #002200;">&#123;</span>    
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Add code to open bundled Web site</span>
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>path <span style="color: #002200;">=</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>
					  pathForResource<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;index&quot;</span>
					  ofType<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;html&quot;</span>
					  inDirectory<span style="color: #002200;">:</span>WWW_ROOT <span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>url <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> fileURLWithPath<span style="color: #002200;">:</span>path<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSURLRequest</span> <span style="color: #002200;">*</span>request <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLRequest</span> requestWithURL<span style="color: #002200;">:</span>url<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>webView loadRequest<span style="color: #002200;">:</span>request<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Override point for customization after application launch</span>
&nbsp;
    <span style="color: #002200;">&#91;</span>window makeKeyAndVisible<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">return</span> <span style="color: #a61390;">YES</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><b>Interface Builder</b></p>
<p>1. In Xcode expand the iPad folder<br />
2. Double click: MainWindow_Pad.xib to launch Interface Builder<br />
3. Double click Window to bring up the iPad layout<br />
4. Drag a Tool Bar to the bottom of the window<br />
5. Click on the Tool Bar&#8217;s Item button and press Command-D three times so you end up with four buttons.<br />
6. Change the first two buttons to be labeled &#8220;Back&#8221; and &#8220;Forward&#8221;<br />
7. Click on the third button and press Command-1 to bring up the Attributes Inspector panel<br />
8. Change the Identifier of the button to &#8220;Refresh&#8221;<br />
9. Do the same for the fourth button, make its Identifier &#8220;Stop&#8221;<br />
10. Drag a Flexible Space Bar Button Item between the two middle buttons<br />
11. Drag a UIWebView from the Library above the toolbar and let if fill the rest of the window</p>
<p><strong>Wire it Up</strong></p>
<p>12. Click on App Delegate Pad<br />
13. Press: Command-2 to bring up the Connections Inspector panel<br />
14. Under Outlets drag from the circle next to webView to the UIWebView in the Window<br />
15. Click on the UIWebView<br />
16. Press: Command-2 to bring up the Connections Inspector panel<br />
17. Under Received Actions drag from the circles next to the actions to the matching buttons (goBack to Back button, etc).<br />
18. Select: File / Save<br />
19. Repeat all these steps for the iPhone folder</p>
<p><strong>Test It</strong></p>
<p>If you set things for Simulator 3.2 the iPad simulator should come up.<br />
If you set things for Simulator 3.1 the iPhone simulator should come up.</p>
<hr size="1" />
<p><strong>Source Code</strong></p>
<p>If you have git installed, you can obtain a copy of the project in this tutorial by executing the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">git clone git@github.com:mitchallen/TestWebApp01.git</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/552/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>I&#8217;ve updated the UITableView sample</title>
		<link>http://mitchallen.com/iphone/archives/549</link>
		<comments>http://mitchallen.com/iphone/archives/549#comments</comments>
		<pubDate>Fri, 30 Apr 2010 05:43:16 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[UITableView]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=549</guid>
		<description><![CDATA[Since the UITableView sample has been generating a lot of comments (and some frustration), I&#8217;ve posted an update compiled with the latest 3.x SDK: http://mitchallen.com/iphone/archives/184 The update includes a link to a new sample that you can clone from github.]]></description>
			<content:encoded><![CDATA[<p>Since the UITableView sample has been generating a lot of comments (and some frustration), I&#8217;ve posted an update compiled with the latest 3.x SDK:</p>
<p><a href="http://mitchallen.com/iphone/archives/184">http://mitchallen.com/iphone/archives/184</a></p>
<p>The update includes a link to a new sample that you can clone from github.</p>
<p><a href="http://mitchallen.com/iphone/wp-content/uploads/2009/05/Screen-shot-2010-04-29-at-10.36.44-PM.png"><img class="aligncenter size-medium wp-image-547" title="Screen shot 2010-04-29 at 10.36.44 PM" src="http://mitchallen.com/iphone/wp-content/uploads/2009/05/Screen-shot-2010-04-29-at-10.36.44-PM-231x300.png" alt="" width="231" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/549/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publishing to the iBookstore</title>
		<link>http://mitchallen.com/iphone/archives/528</link>
		<comments>http://mitchallen.com/iphone/archives/528#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:11:17 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[comics]]></category>
		<category><![CDATA[iBookstore]]></category>
		<category><![CDATA[EPUB]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=528</guid>
		<description><![CDATA[As a published author, I&#8217;ve been interested in self-publishing books for Apple&#8217;s iBookstore. If you think that you would like to self-publish too, then you need two things: A complete book in an acceptable EPUB format or a simple document file that can be converted An Apple-approved iBookstore aggregator To find the latest list of [...]]]></description>
			<content:encoded><![CDATA[<p>As a published author, I&#8217;ve been interested in self-publishing books for <a title="Apple's iBookstore" href="http://www.apple.com/ipad/features/ibooks.html">Apple&#8217;s iBookstore</a>.  If you think that you would like to self-publish too, then you need two things:</p>
<ul>
<li>A <em>complete</em> book in an acceptable EPUB format or a simple document file that can be converted</li>
<li>An Apple-approved iBookstore aggregator</li>
</ul>
<p>To find the latest list of aggregators, visit this link and choose &#8220;Book&#8221;, press Continue and click on the aggregator link:</p>
<p><a title="https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/wa/apply" href="https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/wa/apply">https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/wa/apply</a></p>
<p>Some services will convert things like Word docs for you. Others expect you to supply a valid EPUB file.  Some services will charge a flat fee, possibly an annual fee. Others will extract a royalty.</p>
<p>For info on trying to come up with a valid EPUB formatted book, see this link:</p>
<p><a title="Idle Thoughts: Getting into the Apple Bookstore with ePub 1.0.5" href="http://henrymelton.blogspot.com/2010/04/getting-into-apple-bookstore-with-epub.html">http://henrymelton.blogspot.com/2010/04/getting-into-apple-bookstore-with-epub.html</a></p>
<p><strong>What Works, What Doesn&#8217;t</strong></p>
<p>You may notice that some aggregators stress only submitting text, nothing too fancy or image-laden.  I&#8217;m interested in publishing three type of books:  novel (simply text), programming books (source code listings, maybe some screen shots) and graphic novels.  The last one probably won&#8217;t work well in an EPUB format.  So for that I will stick to my original idea of <a title="publishing comics as an iPhone app." href="http://mitchallen.com/iphone/archives/tag/dark-horse-comics">publishing comics as an iPhone app</a>.</p>
<p>For a programming book I will probably be better off doing my own conversion.  I&#8217;ll need to use a service that lets me submit my own finished EPUB file.</p>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/528/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Cocos2D to work with the iPad</title>
		<link>http://mitchallen.com/iphone/archives/506</link>
		<comments>http://mitchallen.com/iphone/archives/506#comments</comments>
		<pubDate>Fri, 29 Jan 2010 17:53:37 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[game engines]]></category>
		<category><![CDATA[Cocos2D]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=506</guid>
		<description><![CDATA[If you look at the source code for Cocos2D, you will find this little note in Director.m: // XXX it's using hardcoded values. // What if the the screen size changes in the future? This isn&#8217;t a problem if you want to run your iPhone app in what I call &#8220;boxed&#8221; mode &#8211; in it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>If you look at the source code for Cocos2D, you will find this little note in <strong>Director.m</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">	<span style="color: #11740a; font-style: italic;">// XXX it's using hardcoded values.</span>
	<span style="color: #11740a; font-style: italic;">// What if the the screen size changes in the future?</span></pre></div></div>

<p>This isn&#8217;t a problem if you want to run your iPhone app in what I call &#8220;boxed&#8221; mode &#8211; in it&#8217;s native resolution on the center of the iPad screen.  But if you want to start working on your code in the native iPad resolution of 1024 x 768 you will need to get the latest build (SVN r1753).</p>
<p>See this thread:  <a href="http://www.cocos2d-iphone.org/forum/topic/4108">http://www.cocos2d-iphone.org/forum/topic/4108</a></p>
<p><strong>Screenshot</strong></p>
<p>Note that the controls are now properly scaled.  Obviously one pending issue is substituting a background graphic with the proper resolution.</p>
<div id="attachment_518" class="wp-caption alignnone" style="width: 310px"><a href="http://mitchallen.com/iphone/wp-content/uploads/2010/01/iPadSim5.png"><img src="http://mitchallen.com/iphone/wp-content/uploads/2010/01/iPadSim5-300x247.png" alt="" title="iPadSim5" width="300" height="247" class="size-medium wp-image-518" /></a><p class="wp-caption-text">iPad app using hacked Cocos2D engine</p></div>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/506/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The new iPad Simulator</title>
		<link>http://mitchallen.com/iphone/archives/482</link>
		<comments>http://mitchallen.com/iphone/archives/482#comments</comments>
		<pubDate>Thu, 28 Jan 2010 17:00:29 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[simulator]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=482</guid>
		<description><![CDATA[Below are some screenshots of the new iPad simulator. To use it you will need to install the latest Beta SDK that was announced yesterday, along with the announcement of the new iPad. To get your app to work in the iPad simulator you will need to do a couple of things: Switch your build [...]]]></description>
			<content:encoded><![CDATA[<p>Below are some screenshots of the new iPad simulator.  To use it you will need to install the latest Beta SDK that was announced yesterday, <strong><a href="http://events.apple.com.edgesuite.net/1001q3f8hhr/event/index.html">along with the announcement of the new iPad</a></strong>.</p>
<p>To get your app to work in the iPad simulator you will need to do a couple of things:</p>
<ol>
<li>Switch your build to: <strong>Simulator 3.2 | Debug</strong></li>
<li>When your app is running in the simulator, select: <strong>Hardware / Device / iPad</strong></li>
</ol>
<p><strong>Universal Applications</strong></p>
<p>The above was just to get you started and see your app running on the iPad in what I call a &#8220;boxed&#8221; version.  Ideally you would want to work towards what Apple refers to as a &#8220;<strong>universal application</strong>&#8221; &#8211; that is optimized for whichever device it happens to be running on.  Though Apple notes that universal binaries won&#8217;t be available in the initial seed release of 3.2.   See the Beta doc for more info.</p>
<p><strong>Creating a true iPad target</strong></p>
<p>To turn an existing app into a native iPad app, right-click on your target and select: <strong>Transition</strong>.  Then change your target executable to the new iPad version.  Note that right-clicking on the iPad target and selecting<strong> Build &#8220;&#8230;-iPad&#8221; Start</strong> doesn&#8217;t work if the wrong target is selected in the IDE dropdown.  Your app will still appear as a boxed iPhone app.  Once you have it running as a true iPad app, if you hard-coded a few things based on the original iPhones resolution, you&#8217;ll have some cleaning up to do.</p>
<p><strong>Just one more thing &#8230;</strong></p>
<p>When working on a 17&#8243; MacBook Pro, I found that the simulator crowds the dock on the bottom of the desktop.  So you may want to consider moving your dock to the side.</p>
<hr size="1" />

<a href='http://mitchallen.com/iphone/archives/482/ipadsim1' title='iPadSim1'><img width="150" height="150" src="http://mitchallen.com/iphone/wp-content/uploads/2010/01/iPadSim1-150x150.png" class="attachment-thumbnail" alt="Default iPad Simulator in Landscape Mode" title="iPadSim1" /></a>
<a href='http://mitchallen.com/iphone/archives/482/ipadsim2' title='iPadSim2'><img width="150" height="150" src="http://mitchallen.com/iphone/wp-content/uploads/2010/01/iPadSim2-150x150.png" class="attachment-thumbnail" alt="iPad Simulator running standard iPhone app - notice 2x option in the lower right corner" title="iPadSim2" /></a>
<a href='http://mitchallen.com/iphone/archives/482/ipadsim3' title='iPadSim3'><img width="150" height="150" src="http://mitchallen.com/iphone/wp-content/uploads/2010/01/iPadSim3-150x150.png" class="attachment-thumbnail" alt="iPad Simulator running standard iPhone app at 2x resolution" title="iPadSim3" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/482/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Links for when your iPhone app crashes</title>
		<link>http://mitchallen.com/iphone/archives/469</link>
		<comments>http://mitchallen.com/iphone/archives/469#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:57:01 +0000</pubDate>
		<dc:creator>Mitch  Allen</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[dSYM]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[symbolicatecrash]]></category>

		<guid isPermaLink="false">http://mitchallen.com/iphone/?p=469</guid>
		<description><![CDATA[As I&#8217;ve mentioned before, my background is in software testing. I&#8217;ve made a career out of making software crash. You may think your app is flawless &#8211; that it can&#8217;t possibly crash. Wait until you hand it off to someone else. If that person is sitting right next to you, you may be able to [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve mentioned before, my background is in software testing. I&#8217;ve made a career out of making software crash. You may think your app is flawless &#8211; that it can&#8217;t possibly crash. Wait until you hand it off to someone else. If that person is sitting right next to you, you may be able to walk through the steps in the debugger in the simulator and figure out what happened. But if that person is someone who downloaded your app from iTunes &#8211; or worse, <em>a whole lot of people</em> who bought your app from iTunes &#8211; and it only crashes on the actual device &#8211; then things will get a lot more complicated.</p>
<p><strong>Reproducing a Crash</strong></p>
<p>When a professional software tester, such as myself, crashes a product our job is to try to reproduce the crash and write up detailed steps on how we did it. But when the product crashes in the field customers aren&#8217;t so helpful. Quite often they will tell you that they have no idea how the product crashed, or they don&#8217;t have the patience to try to reproduce it. Hopefully you will at least be able to get them to give you a log. What log is that you may wonder? Is this something that you build in to your product? It could be &#8211; but I&#8217;m talking about the crash log that the iPhone will (hopefully) generate automatically and replicate to their desktop via iTunes.</p>
<p>A great article on where the crash logs are located and how to process them can be found here:</p>
<p><a href="http://www.anoshkin.net/blog/2008/09/09/iphone-crash-logs/">http://www.anoshkin.net/blog/2008/09/09/iphone-crash-logs/</a></p>
<p>In that article you will find out how to use a very useful tool: <strong>symbolicatecrash</strong> .  Pay close attention to the instructions on generating and keeping a <strong>dSYM </strong>file when you release an app.  </p>
<p>The article also contains a few useful links:  </p>
<ul>
<li><a href="http://developer.apple.com/tools/xcode/symbolizingcrashdumps.html">http://developer.apple.com/tools/xcode/symbolizingcrashdumps.html</a></li>
<li><a href="http://developer.apple.com/mac/library/technotes/tn2004/tn2123.html">http://developer.apple.com/mac/library/technotes/tn2004/tn2123.html</a></li>
<li><a href="http://furbo.org/2008/08/08/symbolicatifination/">http://furbo.org/2008/08/08/symbolicatifination/</a></li>
</ul>
<p>For debugging apps you may find these articles useful as well:</p>
<ul>
<li><a href="http://cocoawithlove.com/2008/10/debugging-tips-for-objective-c.html">http://cocoawithlove.com/2008/10/debugging-tips-for-objective-c.html</a></li>
<li><a href="http://siliconbased.wordpress.com/2009/08/19/iphone-sdk-gdb-debugging-cheat-sheet/">http://siliconbased.wordpress.com/2009/08/19/iphone-sdk-gdb-debugging-cheat-sheet/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mitchallen.com/iphone/archives/469/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
