<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5345587271858253070</id><updated>2011-08-21T08:15:18.311-07:00</updated><category term='Code'/><category term='Skrambler'/><title type='text'>I Code 4 iPhone</title><subtitle type='html'>Skrambler: Jigsaw Puzzle for the iPhone</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-123325172194336355</id><published>2009-09-17T13:16:00.001-07:00</published><updated>2009-09-17T13:43:07.791-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><title type='text'>Lady Monet Gets Unskrambled</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_26i1-OkyNsE/SrKZ6U5mCbI/AAAAAAAAAiI/YFGRT8HmKfA/s1600-h/IMG_1109.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 240px; height: 320px;" src="http://4.bp.blogspot.com/_26i1-OkyNsE/SrKZ6U5mCbI/AAAAAAAAAiI/YFGRT8HmKfA/s320/IMG_1109.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5382533731982903730" /&gt;&lt;/a&gt;&lt;br /&gt;We used the artwork of old masters in the public domain since we didn't want to deal with copyrights for the first version of Skrambler. Normally copyright on the artwork exists for 70 years after the artist's death. Even then, museums and galleries can hold a copyright on the reproduction of these images. It was a lot of work trying to track down if a particular image is under copyright.&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For future versions of Skrambler, we hope to work with museums and galleries to bring their collections into the game.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Un-skrambling infront of the real paintings is kind of fun. The National Gallery of Art in Washington DC is amazing, and free!&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-123325172194336355?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/123325172194336355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/09/getting-content.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/123325172194336355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/123325172194336355'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/09/getting-content.html' title='Lady Monet Gets Unskrambled'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_26i1-OkyNsE/SrKZ6U5mCbI/AAAAAAAAAiI/YFGRT8HmKfA/s72-c/IMG_1109.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-481785725570420159</id><published>2009-09-06T14:02:00.000-07:00</published><updated>2009-09-17T13:29:32.432-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Removing the Default Shine from Icons</title><content type='html'>Apple makes it easy to create a good looking app icon. I just needed to specify a square PNG image file named Icon.png and the OS takes care of creating a rounded edge and overlaying it with a consistant shine over it.&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 248px; height: 100px;" src="http://1.bp.blogspot.com/_26i1-OkyNsE/SqQkk_I_peI/AAAAAAAAAhw/rx1ADRpdjLc/s400/icon_samples.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378464072830264802" /&gt;&lt;/div&gt;&lt;div&gt;I wanted to make my icon have a distinctive hex shape. I created a PNG with a transparency background but found that it didn't quite work because the default shading was ruining the effect. In order to remove the shading, I needed to modify the Info.plist file. This file holds the app's basic settings and is usually prefixed with the app's name, e.g. Skrambler-Info.plist. The setting for removing the shine is not available by default so it is not available in the Xcode editor. I needed to open the file in a text editor and add the following lines:&lt;/div&gt;&lt;div&gt;&lt;pre&gt; &amp;lt;key&gt;UIPrerenderedIcon&amp;lt;/key&gt; &amp;lt;true/&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;Another useful setting is to hide the status bar when the app is starting.&lt;/div&gt;&lt;div&gt;&lt;pre&gt; &amp;lt;key&gt;UIStatusBarHidden&amp;lt;/key&gt; &amp;lt;true/&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-481785725570420159?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/481785725570420159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/09/removing-shine-from-icons.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/481785725570420159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/481785725570420159'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/09/removing-shine-from-icons.html' title='Removing the Default Shine from Icons'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_26i1-OkyNsE/SqQkk_I_peI/AAAAAAAAAhw/rx1ADRpdjLc/s72-c/icon_samples.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-5276870354390399022</id><published>2009-08-29T10:21:00.000-07:00</published><updated>2009-09-06T18:42:54.374-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><title type='text'>Telling a Story in a Puzzle Game</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_26i1-OkyNsE/Splxnd26kzI/AAAAAAAAAho/c1uxGxkTnx4/s1600-h/Default.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 214px; height: 320px;" src="http://3.bp.blogspot.com/_26i1-OkyNsE/Splxnd26kzI/AAAAAAAAAho/c1uxGxkTnx4/s320/Default.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5375452553087193906" /&gt;&lt;/a&gt;&lt;br /&gt;People play puzzle games because they want to solve puzzles. While an adventure game is kind of like a puzzle game, the main focus is the story. In a game like Skrambler, the main focus is putting the images together. While I believe that having a back story can enrich the gaming experience, putting too much 'in-your-face' story elements can also disrupt gameplay, especially in a puzzle game.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The approach I have taken in Skrambler is to inject story elements around the game to indicate that there is a larger context to the game. For example, the Skrambler device is designed to look like an ancient mechanical artifact with a subtle marking that says "Property of Chronus" that perhaps might give some clues to the origin of the device. The splash screen also gives some indication of the world surrounding Skrambler.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These elements provides hints at the world around the game, and gives clues to why the player might be putting images together. For the player that is so inclined, he or she may delve more into the story, but for the casual player that is only interested in the puzzle elements, there are no distractions.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-5276870354390399022?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/5276870354390399022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/telling-story-in-puzzle-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/5276870354390399022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/5276870354390399022'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/telling-story-in-puzzle-game.html' title='Telling a Story in a Puzzle Game'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_26i1-OkyNsE/Splxnd26kzI/AAAAAAAAAho/c1uxGxkTnx4/s72-c/Default.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-708363363006408425</id><published>2009-08-21T14:38:00.000-07:00</published><updated>2009-09-06T18:45:30.544-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>There Can Be Only One--Using Singletons to Organize Your Program</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_26i1-OkyNsE/So8griY4G8I/AAAAAAAAAhY/H9wetEUsjTM/s1600-h/Picture+1.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 192px; height: 200px;" src="http://4.bp.blogspot.com/_26i1-OkyNsE/So8griY4G8I/AAAAAAAAAhY/H9wetEUsjTM/s200/Picture+1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5372548812813900738" /&gt;&lt;/a&gt;&lt;br /&gt;In a game, or in any other program, it is customary to store game session data in a common place so that different views and controllers access them. The data might be game state, player score or user preferences. One place to store them is as global variables. This is acceptable for a small program, but as your program grows larger, it is easy to loose track of them.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've been using the singleton pattern to store common variables. For those that are new to singletons, it is simply an object that exist as a single instance. It is instantiated at the start of the application (or when first accessed) and is retained in memory until the end.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm naming these singleton classes Managers in my program. For example, there is a GameManager class for holding the game state, a ViewManager that knows about all the views, and a SoundManager that is used to play game sounds.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm using the singleton template written by Matt Gallagher for simplicity, but you can certainly write your own. You can find more information about singletons on his blog post titled &lt;a href="http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html"&gt;Singletons, AppDelegates and top-level data&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-708363363006408425?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/708363363006408425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/there-can-be-only-one-using-singletons.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/708363363006408425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/708363363006408425'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/there-can-be-only-one-using-singletons.html' title='There Can Be Only One--Using Singletons to Organize Your Program'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_26i1-OkyNsE/So8griY4G8I/AAAAAAAAAhY/H9wetEUsjTM/s72-c/Picture+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-7193975649746354906</id><published>2009-08-17T08:19:00.000-07:00</published><updated>2009-09-17T13:43:35.445-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><title type='text'>Choosing the Appropriate Framework</title><content type='html'>&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 92px; height: 77px;" src="http://2.bp.blogspot.com/_26i1-OkyNsE/Sol8Oj34TvI/AAAAAAAAAhI/rqZFZiyz_4A/s400/Picture+2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5370960620205657842" /&gt;I decided to use UIKit, which is the basic framework in the iPhone SDK for managing the user interface elements. The Interface Builder is a great tool for laying out UI components. I can drag-and-drop elements, such as buttons, onto the view and re-skin them to fit the look of the game. Using OpenGL ES is an alternative option but that has a steeper learning curve. For something 2D and not graphics intensive, UIKit works very well.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The UIView has built in functionality to perform key-frame animation on the various properties. For example, we can change the alpha value to fade-in and out view elements, or even provide transformation matrices for more complex movements.&lt;/div&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 185px; height: 200px;" src="http://2.bp.blogspot.com/_26i1-OkyNsE/Sol9AfPN5_I/AAAAAAAAAhQ/l1Frv4luM9M/s200/Picture+3.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5370961477954824178" /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are also a few third-party frameworks that I looked at. I was impressed with &lt;a href="http://unity3d.com/"&gt;Unity 3D&lt;/a&gt;, especially with the GUI development environment. You can do all your game logic in scripts and would not have to touch Objective-C at all. In the end I felt that it was a bit of an overkill for a simple 2D game, but I might revisit it later for future projects. The ability to target multiple platforms (i.e. web, desktop) is very attractive.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I also looked at &lt;a href="http://www.garagegames.com/"&gt;Torque 2D&lt;/a&gt; but found it a bit confusing. Unity definitely has better documentation and tutorials to get you started, and feels like a more polished product.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is also &lt;a href="http://code.google.com/p/cocos2d-iphone/"&gt;coscos2d&lt;/a&gt; which is an open-source 2D framework if you want to go the free route.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-7193975649746354906?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/7193975649746354906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/choosing-appropriate-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/7193975649746354906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/7193975649746354906'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/choosing-appropriate-framework.html' title='Choosing the Appropriate Framework'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_26i1-OkyNsE/Sol8Oj34TvI/AAAAAAAAAhI/rqZFZiyz_4A/s72-c/Picture+2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-7835465865741624291</id><published>2009-08-16T10:28:00.000-07:00</published><updated>2009-08-16T10:45:26.580-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Making Tiles</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_26i1-OkyNsE/SohCqyfHDbI/AAAAAAAAAg4/06Euou8b4iE/s1600-h/masking.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 253px; height: 233px;" src="http://1.bp.blogspot.com/_26i1-OkyNsE/SohCqyfHDbI/AAAAAAAAAg4/06Euou8b4iE/s320/masking.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5370615858513513906" /&gt;&lt;/a&gt;&lt;br /&gt;Creating hexagonal tiles from the image involves applying a tile mask and cutting up the image into smaller UIImageView objects. A layer of shading is also applied to add a little depth to the tiles.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I created a class called Puzzle that is derived from the UIImageView class. The makeTileAtPoint method creates a Tile object (another UIImageView class) at that location, and adds it to an array of tiles.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;- (&lt;span style="color:#aa0d91;"&gt;void&lt;/span&gt;)makeTileAtPoint:(&lt;span style="color:#5c2699;"&gt;CGPoint&lt;/span&gt;)point {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;CGImageRef&lt;/span&gt; maskRef = [&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt; &lt;span style="color:#2e0d6e;"&gt;imageNamed&lt;/span&gt;:&lt;span style="color:#c41a16;"&gt;@"shading.png"&lt;/span&gt;].CGImage; &lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;CGImageRef&lt;/span&gt; flatMaskRef = [&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt; &lt;span style="color:#2e0d6e;"&gt;imageNamed&lt;/span&gt;:&lt;span style="color:#c41a16;"&gt;@"mask.png"&lt;/span&gt;].CGImage;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;int&lt;/span&gt; width = &lt;span style="color:#2e0d6e;"&gt;CGImageGetWidth&lt;/span&gt;(maskRef);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;int&lt;/span&gt; height = &lt;span style="color:#2e0d6e;"&gt;CGImageGetHeight&lt;/span&gt;(maskRef);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt;* tileRectImage = [&lt;span style="color:#aa0d91;"&gt;self&lt;/span&gt; &lt;span style="color:#26474b;"&gt;imageFromImage&lt;/span&gt;:&lt;span style="color:#aa0d91;"&gt;self&lt;/span&gt;.&lt;span style="color:#3f6e74;"&gt;image&lt;/span&gt; &lt;span style="color:#26474b;"&gt;inRect&lt;/span&gt;:&lt;span style="color:#2e0d6e;"&gt;CGRectMake&lt;/span&gt;(point.&lt;span style="color:#5c2699;"&gt;x&lt;/span&gt;, point.&lt;span style="color:#5c2699;"&gt;y&lt;/span&gt;, width, height)];&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// Clip the tile (the mask is not clipping the image properly)&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#2e0d6e;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#5c2699;"&gt;CGColorSpaceRef&lt;/span&gt;&lt;span style="color:#000000;"&gt; colorSpace = &lt;/span&gt;CGColorSpaceCreateDeviceRGB&lt;span style="color:#000000;"&gt;();&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// create a bitmap graphics context the size of the image&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;CGContextRef&lt;/span&gt; mainViewContentContext = &lt;span style="color:#2e0d6e;"&gt;CGBitmapContextCreate&lt;/span&gt; (&lt;span style="color:#aa0d91;"&gt;NULL&lt;/span&gt;, width, height, &lt;span style="color:#1c00cf;"&gt;8&lt;/span&gt;, &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;, colorSpace, &lt;span style="color:#2e0d6e;"&gt;kCGImageAlphaPremultipliedLast&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// free the rgb colorspace&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#2e0d6e;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;CGColorSpaceRelease&lt;span style="color:#000000;"&gt;(colorSpace);    &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;if&lt;/span&gt; (mainViewContentContext==&lt;span style="color:#aa0d91;"&gt;NULL&lt;/span&gt;)&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;        &lt;span style="color:#aa0d91;"&gt;   return&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// Define the mask for the tile&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#2e0d6e;"&gt;CGContextClipToMask&lt;/span&gt;(mainViewContentContext, &lt;span style="color:#2e0d6e;"&gt;CGRectMake&lt;/span&gt;(&lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;, &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;, width, height), flatMaskRef);&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// Draw the tile image&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#2e0d6e;"&gt;CGContextDrawImage&lt;/span&gt;(mainViewContentContext, &lt;span style="color:#2e0d6e;"&gt;CGRectMake&lt;/span&gt;(&lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;, &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;, width, height), tileRectImage.CGImage);&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// Draw the shine and shadow for the tile&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#2e0d6e;"&gt;CGContextDrawImage&lt;/span&gt;(mainViewContentContext, &lt;span style="color:#2e0d6e;"&gt;CGRectMake&lt;/span&gt;(&lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;, &lt;span style="color:#1c00cf;"&gt;0&lt;/span&gt;, width, height), maskRef);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// Create CGImageRef of the main view bitmap content, and then&lt;/p&gt; &lt;p  style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color:#007400;"&gt;&lt;span style="color:#000000;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;// release that bitmap context&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;CGImageRef&lt;/span&gt; mainViewContentBitmapContext = &lt;span style="color:#2e0d6e;"&gt;CGBitmapContextCreateImage&lt;/span&gt;(mainViewContentContext);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#2e0d6e;"&gt;CGContextRelease&lt;/span&gt;(mainViewContentContext);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt;* tileImage = [&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt; &lt;span style="color:#2e0d6e;"&gt;imageWithCGImage&lt;/span&gt;:mainViewContentBitmapContext];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#2e0d6e;"&gt;CGImageRelease&lt;/span&gt;(mainViewContentBitmapContext);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#3f6e74;"&gt;Tile&lt;/span&gt;* tile = [[&lt;span style="color:#3f6e74;"&gt;Tile&lt;/span&gt; &lt;span style="color:#2e0d6e;"&gt;alloc&lt;/span&gt;] &lt;span style="color:#2e0d6e;"&gt;initWithImage&lt;/span&gt;:tileImage];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;tile.frame = &lt;span style="color:#2e0d6e;"&gt;CGRectMake&lt;/span&gt;(point.&lt;span style="color:#5c2699;"&gt;x&lt;/span&gt;, point.&lt;span style="color:#5c2699;"&gt;y&lt;/span&gt;, width, height);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[&lt;span style="color:#3f6e74;"&gt;tiles&lt;/span&gt; &lt;span style="color:#2e0d6e;"&gt;addObject&lt;/span&gt;:tile];&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;}&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;- (&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt; *)imageFromImage:(&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt; *)srcImage inRect:(&lt;span style="color:#5c2699;"&gt;CGRect&lt;/span&gt;)rect {&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;CGImageRef&lt;/span&gt; sourceImageRef = [srcImage &lt;span style="color:#2e0d6e;"&gt;CGImage&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;CGImageRef&lt;/span&gt; newImageRef = &lt;span style="color:#2e0d6e;"&gt;CGImageCreateWithImageInRect&lt;/span&gt;(sourceImageRef, rect);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt; *newImage = [&lt;span style="color:#5c2699;"&gt;UIImage&lt;/span&gt; &lt;span style="color:#2e0d6e;"&gt;imageWithCGImage&lt;/span&gt;:newImageRef];&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#2e0d6e;"&gt;CGImageRelease&lt;/span&gt;(newImageRef);&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span style="color:#aa0d91;"&gt;return&lt;/span&gt; newImage;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco"&gt;}&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-7835465865741624291?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/7835465865741624291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/making-tiles.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/7835465865741624291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/7835465865741624291'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/making-tiles.html' title='Making Tiles'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_26i1-OkyNsE/SohCqyfHDbI/AAAAAAAAAg4/06Euou8b4iE/s72-c/masking.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-4110355401413168567</id><published>2009-08-15T10:25:00.000-07:00</published><updated>2010-10-28T15:07:46.790-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Parsing CSV files</title><content type='html'>I've been looking for a simple CSV file parser in the SDK and couldn't find one, so I decided to write one so that I can use it to read in level data into the game. I like working with CSV files because I can use a spreadsheet program to maintain the data. The method takes a line of text and splits it up into an string array of phrases. The method handles double-quoted phrases as well as commas that appear within the phrases.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Update:&lt;/b&gt; I've updated the code based on feedback by Rich and KaleidoBalls, as well as fixed a memory leak. Thanks, all!&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt; &lt;style type="text/css"&gt; p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #743fa4} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #40207c} p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #c02d9d} p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008324} span.s1 {color: #743fa4} span.s2 {color: #000000} span.s3 {color: #40207c} span.s4 {color: #d62c24} span.s5 {color: #c02d9d} span.s6 {color: #2f2fd0} span.Apple-tab-span {white-space:pre} &lt;/style&gt;   &lt;p class="p1"&gt;+ (&lt;span class="s1"&gt;NSMutableArray&lt;/span&gt;*)readLine:(&lt;span class="s1"&gt;NSString&lt;/span&gt;*)fileLine {&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;NSMutableArray&lt;span class="s2"&gt;* partsData = [[&lt;/span&gt;NSMutableArray&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="s3"&gt;alloc&lt;/span&gt;&lt;span class="s2"&gt;] &lt;/span&gt;&lt;span class="s3"&gt;init&lt;/span&gt;&lt;span class="s2"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;NSMutableArray&lt;span class="s2"&gt;* phrase = [[&lt;/span&gt;NSMutableArray&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="s3"&gt;alloc&lt;/span&gt;&lt;span class="s2"&gt;] &lt;/span&gt;&lt;span class="s3"&gt;init&lt;/span&gt;&lt;span class="s2"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s1"&gt;NSArray&lt;/span&gt;* tempPartsData = [fileLine &lt;span class="s3"&gt;componentsSeparatedByString&lt;/span&gt;:&lt;span class="s4"&gt;@","&lt;/span&gt;];&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s5"&gt;for&lt;/span&gt; (&lt;span class="s1"&gt;NSString&lt;/span&gt;* origPart &lt;span class="s5"&gt;in&lt;/span&gt; tempPartsData) {&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="s1"&gt;NSString&lt;/span&gt;&lt;span class="s2"&gt;* part = [[&lt;/span&gt;&lt;span class="s1"&gt;NSString&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;alloc&lt;span class="s2"&gt;] &lt;/span&gt;initWithString&lt;span class="s2"&gt;:[origPart &lt;/span&gt;stringByTrimmingCharactersInSet&lt;span class="s2"&gt;:[&lt;/span&gt;&lt;span class="s1"&gt;NSCharacterSet&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;whitespaceAndNewlineCharacterSet&lt;span class="s2"&gt;]]];&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s5"&gt;if&lt;/span&gt; ([part &lt;span class="s3"&gt;length&lt;/span&gt;] == &lt;span class="s6"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[part &lt;span class="s3"&gt;release&lt;/span&gt;];&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;continue&lt;span class="s2"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s5"&gt;if&lt;/span&gt; ([part &lt;span class="s3"&gt;characterAtIndex&lt;/span&gt;:&lt;span class="s6"&gt;0&lt;/span&gt;] == &lt;span class="s6"&gt;'"'&lt;/span&gt; &amp;amp;&amp;amp; [part &lt;span class="s3"&gt;characterAtIndex&lt;/span&gt;:[part &lt;span class="s3"&gt;length&lt;/span&gt;]-&lt;span class="s6"&gt;1&lt;/span&gt;] != &lt;span class="s6"&gt;'"'&lt;/span&gt;) {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// Starting phrase&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;/span&gt;addObject&lt;span class="s2"&gt;:[part &lt;/span&gt;substringFromIndex&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="s6"&gt;1&lt;/span&gt;&lt;span class="s2"&gt;]];&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;} &lt;span class="s5"&gt;else&lt;/span&gt; &lt;span class="s5"&gt;if&lt;/span&gt; ([part &lt;span class="s3"&gt;characterAtIndex&lt;/span&gt;:&lt;span class="s6"&gt;0&lt;/span&gt;] == &lt;span class="s6"&gt;'"'&lt;/span&gt; &amp;amp;&amp;amp; [part &lt;span class="s3"&gt;length&lt;/span&gt;] == &lt;span class="s6"&gt;1&lt;/span&gt;) {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// Just a lonely quotation mark--a phrase started or ended with a comma&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;span class="s3"&gt;addObject&lt;/span&gt;:&lt;span class="s4"&gt;@""&lt;/span&gt;];&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s5"&gt;if&lt;/span&gt; ([phrase &lt;span class="s3"&gt;count&lt;/span&gt;] == &lt;span class="s6"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// phrase begins with a comma&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;} &lt;span class="s5"&gt;else&lt;/span&gt; {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// phrase ends with a comma&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[partsData &lt;/span&gt;addObject&lt;span class="s2"&gt;:[phrase &lt;/span&gt;componentsJoinedByString&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="s4"&gt;@","&lt;/span&gt;&lt;span class="s2"&gt;]];&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;/span&gt;removeAllObjects&lt;span class="s2"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;} &lt;span class="s5"&gt;else&lt;/span&gt; &lt;span class="s5"&gt;if&lt;/span&gt; ([part &lt;span class="s3"&gt;characterAtIndex&lt;/span&gt;:&lt;span class="s6"&gt;0&lt;/span&gt;] == &lt;span class="s6"&gt;'"'&lt;/span&gt; &amp;amp;&amp;amp; [part &lt;span class="s3"&gt;characterAtIndex&lt;/span&gt;:[part &lt;span class="s3"&gt;length&lt;/span&gt;]-&lt;span class="s6"&gt;1&lt;/span&gt;] == &lt;span class="s6"&gt;'"'&lt;/span&gt;) {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// Complete quoted phrase&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s1"&gt;NSRange&lt;/span&gt; inner;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;inner.&lt;span class="s1"&gt;location&lt;/span&gt; = &lt;span class="s6"&gt;1&lt;/span&gt;;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;inner.&lt;span class="s1"&gt;length&lt;/span&gt; = [part &lt;span class="s3"&gt;length&lt;/span&gt;] - &lt;span class="s6"&gt;2&lt;/span&gt;;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[partsData &lt;span class="s3"&gt;addObject&lt;/span&gt;:[part &lt;span class="s3"&gt;substringWithRange&lt;/span&gt;:inner]];&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;} &lt;span class="s5"&gt;else&lt;/span&gt; &lt;span class="s5"&gt;if&lt;/span&gt; ([part &lt;span class="s3"&gt;characterAtIndex&lt;/span&gt;:[part &lt;span class="s3"&gt;length&lt;/span&gt;]-&lt;span class="s6"&gt;1&lt;/span&gt;] == &lt;span class="s6"&gt;'"'&lt;/span&gt;) {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// Ending phrase&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;/span&gt;addObject&lt;span class="s2"&gt;:[part &lt;/span&gt;substringToIndex&lt;span class="s2"&gt;:[part &lt;/span&gt;length&lt;span class="s2"&gt;]-&lt;/span&gt;&lt;span class="s6"&gt;1&lt;/span&gt;&lt;span class="s2"&gt;]];&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[partsData &lt;/span&gt;addObject&lt;span class="s2"&gt;:[phrase &lt;/span&gt;componentsJoinedByString&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="s4"&gt;@","&lt;/span&gt;&lt;span class="s2"&gt;]];&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;/span&gt;removeAllObjects&lt;span class="s2"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;} &lt;span class="s5"&gt;else&lt;/span&gt; &lt;span class="s5"&gt;if&lt;/span&gt; ([phrase &lt;span class="s3"&gt;count&lt;/span&gt;] &gt; &lt;span class="s6"&gt;0&lt;/span&gt;) {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// Continuing phrase&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;span class="s3"&gt;addObject&lt;/span&gt;:part];&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;} &lt;span class="s5"&gt;else&lt;/span&gt; {&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/span&gt;// Complete phrase&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[partsData &lt;span class="s3"&gt;addObject&lt;/span&gt;:part];&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[part &lt;span class="s3"&gt;release&lt;/span&gt;];&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;/span&gt;removeAllObjects&lt;span class="s2"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[phrase &lt;span class="s3"&gt;release&lt;/span&gt;];&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;&lt;span class="s5"&gt;return&lt;/span&gt; [partsData &lt;span class="s3"&gt;autorelease&lt;/span&gt;];&lt;/p&gt; &lt;p class="p1"&gt;}&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-4110355401413168567?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/4110355401413168567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/reading-csv-files.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/4110355401413168567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/4110355401413168567'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/reading-csv-files.html' title='Parsing CSV files'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-6459865301315530700</id><published>2009-08-14T21:22:00.000-07:00</published><updated>2009-08-14T23:24:43.750-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Skrambler'/><title type='text'>The Jigsaw... Re-imagined</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_26i1-OkyNsE/SoY-LD6014I/AAAAAAAAAgw/AkzH2E6rAJU/s1600-h/hex_tiles.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 176px; height: 200px;" src="http://1.bp.blogspot.com/_26i1-OkyNsE/SoY-LD6014I/AAAAAAAAAgw/AkzH2E6rAJU/s200/hex_tiles.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5370047965437417346" /&gt;&lt;/a&gt;&lt;br /&gt;I've always loved the jigsaw puzzle. There's something uniquely satisfying about putting together  small indistinguishable parts into a unified whole, where the final product is something much more than the sum of its parts. In a way, it is something like creating a software program--little bits of logic that are combined together in a specific pattern to emerge as an entity that has a specific structure and function, as well as beauty.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I set a goal to design an app that has the qualities of a jigsaw puzzle, but one that is more suited for the iPhone. I had two constraints:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;all the pieces should be visible&lt;/li&gt;&lt;li&gt;no scrolling of the image should be necessary&lt;/li&gt;&lt;/ul&gt;Given the relatively small screen real estate, I did not want to split the screen into a holding bin and a picture area. That meant that the pieces and the picture would occupy the same space. The obvious solution, given these constraints, is &lt;i&gt;tile swapping&lt;/i&gt;, i.e. the image will be formed by swapping the tiles amongst themselves.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I played around with various tile shapes and settled on hexagonal tiles. Not only do they make a nice pattern, but I felt that hexagonal tiles would be novel for a jigsaw puzzle.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-6459865301315530700?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/6459865301315530700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/jigsaw-re-imagined.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/6459865301315530700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/6459865301315530700'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/jigsaw-re-imagined.html' title='The Jigsaw... Re-imagined'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_26i1-OkyNsE/SoY-LD6014I/AAAAAAAAAgw/AkzH2E6rAJU/s72-c/hex_tiles.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5345587271858253070.post-6177418015712128384</id><published>2009-08-14T08:23:00.000-07:00</published><updated>2009-08-15T07:28:16.935-07:00</updated><title type='text'>Why...?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_26i1-OkyNsE/SoWGkU_TvpI/AAAAAAAAAgo/sX_c4qRvXqQ/s1600-h/The_Thinker.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 153px; height: 200px;" src="http://4.bp.blogspot.com/_26i1-OkyNsE/SoWGkU_TvpI/AAAAAAAAAgo/sX_c4qRvXqQ/s200/The_Thinker.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5369846089376841362" /&gt;&lt;/a&gt;&lt;br /&gt;There are really a few WHYs to cover. Why the blog? Why the iPhone?... Why code at all? The last is pretty simple. I love to create things, and coding is just one form of creation that is easily accessible and also melds art and science. The iPhone is such a neat and sexy device for us coders because of its simplicity and possibilities to express our creativeness. It wasn't an easy start. When the SDK first came out, information was hard to come by, and I struggled with Objective-C, the programming language that is used for the iPhone (and Macs). I wrote some Hello World type apps and stopped. After about a year of inactivity, I decided to take a stab at it again. With the release of iPhone OS 3.0 with new features such as peer-to-peer networking, support for subscription models and integration with hardware devices, it was too tempting to ignore. This blog is meant as a personal diary, and also to help others who may be starting their own iPhone projects, so that we can share techniques and ideas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5345587271858253070-6177418015712128384?l=icode4iphone.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://icode4iphone.blogspot.com/feeds/6177418015712128384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/why.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/6177418015712128384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5345587271858253070/posts/default/6177418015712128384'/><link rel='alternate' type='text/html' href='http://icode4iphone.blogspot.com/2009/08/why.html' title='Why...?'/><author><name>TAM</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_26i1-OkyNsE/SoWGkU_TvpI/AAAAAAAAAgo/sX_c4qRvXqQ/s72-c/The_Thinker.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
