<?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>bytesizecreations &#187; 42 restaurants</title>
	<atom:link href="http://www.bytesizecreations.com/category/42-restaurants/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bytesizecreations.com</link>
	<description>Musings from a busy mind</description>
	<lastBuildDate>Sun, 14 Jun 2009 17:44:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Programming Lessons: iPhone Style</title>
		<link>http://www.bytesizecreations.com/2009/04/programming-lessons-iphone-style/</link>
		<comments>http://www.bytesizecreations.com/2009/04/programming-lessons-iphone-style/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 09:04:00 +0000</pubDate>
		<dc:creator>Michael Gaylord</dc:creator>
				<category><![CDATA[42 restaurants]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone sdk]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.42restaurants.com/byte/?p=47</guid>
		<description><![CDATA[I have been really busy, as many of you have noticed, the last few months juggling my job at ChessCube and building an iPhone application. I have even gone so far as to only work for ChessCube part-time in order to make time to build my application.

The application I have busy building is called 42 [...]]]></description>
			<content:encoded><![CDATA[<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">I have been really busy, as many of you have noticed, the last few months juggling my job at</span> <a href="http://www.chesscube.com/"><span style="font-size:small;">ChessCube</span></a> <span style="font-size:small;">and building an iPhone application. I have even gone so far as to only work for ChessCube part-time in order to make time to build my application.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">The application I have busy building is called</span> <a href="http://www.42restaurants.com/"><span style="font-size:small;">42 Restaurants</span></a> <span style="font-size:small;">and it was a concept my girlfriend, <a href="http://www.designculprit.com">Margarét</a>, and I came up with one day while sitting in a sushi restaurant. It goes along the lines of producing a really beautiful iPhone application that showcases recipes from some of the best restaurants in the world. You can read more on the 42 Restaurants website</span> <a href="http://www.42restaurants.com/"><span style="text-decoration: underline ; letter-spacing: 0.0px color:#000099;"><span style="font-size:small;">here</span></span></a><span style="font-size:small;">.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">The concept started out simple. My knowledge at the time of the iPhone SDK was very basic and we didn&#8217;t want to be too ambitious. The main features would be amazing pictures, simple functionality and great recipes; all the while providing good marketing for the restaurants involved.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">Now that we are nearing the end of developing the application, I can let everyone in on some tips to hopefully help their progress with their own application.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><b><i><span style="font-size:small;">1. Read, Read, Read</span></i></b></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">The main thing that stood me in good stead for learning the SDK was reading. I read everything, from the</span> <a href="http://developer.apple.com/"><span style="font-size:small;">Apple developer documentation</span></a> <span style="font-size:small;">to blogs and online tutorials. The two books that really helped me the most were -</span> <a href="http://www.amazon.com/iPhone-Developers-Cookbook-Building-Applications/dp/0321555457"><span style="font-size:small;">The iPhone Developers Cookbook</span></a> <span style="font-size:small;">By Erica Sadun and</span> <a href="http://www.amazon.com/Cocoa-Programming-Mac-OS-3rd/dp/0321503619/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1239357583&amp;sr=1-1"><span style="font-size:small;">Cocoa Programming for Mac OS X</span></a> <span style="font-size:small;">by Aaron Hillegass. The best thing about these two books is that the former teaches you how to build and use components in the SDK without needing to worry about things like code structure and development tools. The latter teaches you the fundamentals of Cocoa programming &#8211; even though it contains no coverage of the iPhone SDK.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">Understanding the basics is key to using the iPhone SDK.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><b><i><span style="font-size:small;">2. Get To Know XCode</span></i></b></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">Coming from a development environment from Eclipse, XCode seems at first very different and at times a bit clunky. Now that I have figured out how to use a large portion of it, I can honestly say that I love it. Its simple, fast and it isn&#8217;t intrusive while you are coding. One tip which I think most Eclipse &amp; Netbeans programmers will appreciate is to change the Layout Mode. Go to XCode-&gt;Preferences-&gt;General and change the Layout to All-In-One. All your XCode windows will then be grouped into one place and the interface will alter itself depending on whether your are debugging or coding.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">Another important thing to do is download all the SDK documentation to XCode. Take a look at this great</span> <a href="http://learning2code.blogspot.com/2008/05/download-xcode-docsets-to-your-hard.html"><span style="text-decoration: underline ; letter-spacing: 0.0px color:#000099;"><span style="font-size:small;">blog post</span></span></a> <span style="font-size:small;">to see how to do it without having to use XCode&#8217;s built-in documentation downloading mechanisms.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><b><i><span style="font-size:small;">3. Understand How Interface Builder Works</span></i></b></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">From reading numerous forums on the topic, programmers seem to find it difficult to understand Interface Builder (IB). I was one of them. My distrust of WYSIWYG interface tools led me to building all my view code manually. This, as you can imagine, took me forever until I spent some time trying to understand IB. Now, I pretty much build all my components in IB.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">The main concept I had difficulty grasping with IB was what piece of code fitted with what. Each XIB file has two parts, a File&#8217;s Owner and a View. The File&#8217;s Owner is a class that inherits from UIViewController and the View can be any class that inherits from UIView.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">If you want to initialize a XIB file all you need to do is instantiate your view controller with the method initWithNibNamed and then add the view of that view controller as a subview of whatever view you are currently displaying. If you want to do any post instantiation initialization, such as setting text for a UILabel or applying an image to a UIImageView then you override the method viewDidLoad in your view controller.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">Don&#8217;t forget of course to wire up your IBOutlets and your IBActions in your File&#8217;s Owner to your View and to set your File&#8217;s Owner to be the custom view controller that you have created in XCode. Otherwise, your view will load and nothing will happen.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><b><i><span style="font-size:small;">4. Don&#8217;t Do Cut-and-Paste Coding</span></i></b></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">This seems to be the number one problem in the development community. There are too many programmers that try to code by searching the Internet looking for solutions to their particular problem. Cutting some sample code from a blog or forum post. Pasting it into their project only to find A) it doesn&#8217;t work, B) it is full of bugs or C) badly written.</span></span></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">Understand the principles of what you are trying to do before you go on the web to find a solution. Often you will save time writing the component/algorithm from the ground up and even if you don&#8217;t, you will have learnt a lot in the process. The next time you have to build something similar you can use that knowledge.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><b><i><span style="font-size:small;">5. Don&#8217;t Be Scared to Rewrite Code</span></i></b></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">My application was about 80% complete when I realized I was coding around my solution. The architecture that I had designed was firstly, very inefficient memory-wise and secondly, limiting me in terms of the functionality I needed to add. When I started the project I had a very basic understanding of Objective-C and the iPhone SDK, and my solution thus far had evolved into a big, code beast. So I spent 2 days rewriting the core of the application. I lost 2 days but I gained a whole bunch of functionality, improved memory usage and reduced my code base considerably.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><b><i><span style="font-size:small;">6. Lessons</span></i></b></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">42 Restaurants will hopefully get into the App Store at the end of April. Although the idea seemed simple to start off with, it has grown into a fully fledged recipe application. The sheer amount of design work that Margarét has put into it, makes it in my mind, a masterpiece. Each individual recipe has been custom designed and the application is looking amazing because of it. We both wanted to the application first and foremost to blow the user away with how great it looks and I think we are there.</span></span></p>
<p style="font: 16.0px Georgia; min-height: 19.0px"></p>
<p style="font: 16.0px Georgia"><span style="letter-spacing: 0.0px"><span style="font-size:small;">I hope the code-work on my part will live up to the task. Keep watching this blog and the 42 Restaurants website for news on the launch. We are also on the threshold of starting a round of user testing, so if you have an iPhone and would like to check what we have built so far, post a comment and I will add you to my list of testers.</span></span></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytesizecreations.com/2009/04/programming-lessons-iphone-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
