<?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>kooworx blog</title>
	<atom:link href="http://kooworx.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://kooworx.com/blog</link>
	<description>Development blog for iPhone games and applications</description>
	<lastBuildDate>Thu, 17 Dec 2009 12:06:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Working On The Web Site Now</title>
		<link>http://kooworx.com/blog/2009/12/16/working-on-the-web-site-now/</link>
		<comments>http://kooworx.com/blog/2009/12/16/working-on-the-web-site-now/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 13:48:49 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[kooworx]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=45</guid>
		<description><![CDATA[The blog page has been moved.I moved this blog to the /blog directory, the new web site is coming soon.]]></description>
			<content:encoded><![CDATA[The blog page has been moved.<br /><br />I moved this blog to the /blog directory, the new web site is coming soon.]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/12/16/working-on-the-web-site-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>App &#8211; Word Connect (Lite &amp; Sale)</title>
		<link>http://kooworx.com/blog/2009/09/18/app-word-connect-lite-sale/</link>
		<comments>http://kooworx.com/blog/2009/09/18/app-word-connect-lite-sale/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 07:29:58 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[Game]]></category>
		<category><![CDATA[achievement]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[Casual]]></category>
		<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[Connect]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[leaderboard]]></category>
		<category><![CDATA[openfeint]]></category>
		<category><![CDATA[Puzzle]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Word]]></category>
		<category><![CDATA[Word Connect]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=44</guid>
		<description><![CDATA[ 	Connecting letters and making words in a new way, it&#8217;s full of fun! Here comes the full version of Word Connect &#8211; an addictive word game!The rules are simple, you just need to use the given letters to make words, as many as you can, but the letters must be placed in a single [...]]]></description>
			<content:encoded><![CDATA[<a href="http://kooworx.com/blog/wp-content/uploads/2009/09/WCSale100.jpg"><img src="http://kooworx.com/blog/wp-content/uploads/2009/09/WCSale100.jpg" alt="WCSale100" title="WCSale100" width="100" height="100" class="alignnone size-full wp-image-38" /></a><br /><br /> 	Connecting letters and making words in a new way, it&#8217;s full of fun! Here comes the full version of Word Connect &#8211; an addictive word game!<br /><br />The rules are simple, you just need to use the given letters to make words, as many as you can, but the letters must be placed in a single line. The words you made should have the minimum size of 3 letters. (In the Four Limit game type, you must made words with at least 4 letters)<br /><br />Each round you&#8217;ll get seven letters, each letter must be inserted into the line. Once you&#8217;ve made a word, the letters that made up the word will be lighted up. A game round will be ended when you inserted all the seven letters, then the words you made will be calculated. Try to make more words in a round. If you lighted up all the seven words, you&#8217;ll get score bonus.<br /><br />In the full version, there are three types of Word Connect game included:<br /><br />1 &#8211; Endless. Play as long as you can, try to beat the highest score!<br /><br />2 &#8211; 50 Rounds. Play for 50 Rounds to see how much you can get.<br /><br />3 &#8211; Four Limited. You must made words with at least 4 letters, this is endless, too.<br /><br />One thing more. There is an automatic saving function implemented. So you can just close the game and continue to play next time. But when you continue playing a saved game, the saved progress will be cleared, new progress will be saved when you pass current round.<br /><br />So, let&#8217;s make some words!<br /><br />The full version features:<br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br /><br />* Online global leaderboards and achievements plus Facebook and Twitter integration, courtesy of OpenFeint.<br />* Four leaderboards to challenge.<br />* 18 achievements to be unlocked!<br />* Automatic save game progress.<br />* Sound and background music support.<br />* Smooth animation.<br /><br />Just enjoy the game!<br /><br /><div id="attachment_25" class="wp-caption alignnone" style="width: 126px"><a href="itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=330524374&#038;mt=8&#038;s=143441"><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/appStore.jpg" alt="App Store" title="appStore" width="116" height="40" class="size-full wp-image-25" /></a><p class="wp-caption-text">App Store</p></div><br /><span id="more-44"></span><br />Screenshots:<br /><a href="http://kooworx.com/blog/wp-content/uploads/2009/09/sc1.jpg"><img src="http://kooworx.com/blog/wp-content/uploads/2009/09/sc1.jpg" alt="" title="" width="480" height="320" class="alignnone size-full wp-image-39" /></a><br /><a href="http://kooworx.com/blog/wp-content/uploads/2009/09/sc2.jpg"><img src="http://kooworx.com/blog/wp-content/uploads/2009/09/sc2.jpg" alt="" title="" width="480" height="320" class="alignnone size-full wp-image-39" /></a><br /><a href="http://kooworx.com/blog/wp-content/uploads/2009/09/sc3.jpg"><img src="http://kooworx.com/blog/wp-content/uploads/2009/09/sc3.jpg" alt="" title="" width="480" height="320" class="alignnone size-full wp-image-39" /></a><br /><a href="http://kooworx.com/blog/wp-content/uploads/2009/09/sc4.jpg"><img src="http://kooworx.com/blog/wp-content/uploads/2009/09/sc4.jpg" alt="" title="" width="480" height="320" class="alignnone size-full wp-image-39" /></a><br /><a href="http://kooworx.com/blog/wp-content/uploads/2009/09/sc5.jpg"><img src="http://kooworx.com/blog/wp-content/uploads/2009/09/sc5.jpg" alt="" title="" width="480" height="320" class="alignnone size-full wp-image-39" /></a><br /><br />You can also try the <a href="itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=329879016&#038;mt=8&#038;s=143441">Lite version</a>.]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/09/18/app-word-connect-lite-sale/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>App &#8211; Your Chinese Name Tag</title>
		<link>http://kooworx.com/blog/2009/08/25/app-your-chinese-name-tag/</link>
		<comments>http://kooworx.com/blog/2009/08/25/app-your-chinese-name-tag/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 03:36:33 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[Chinese]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Name]]></category>
		<category><![CDATA[Sale]]></category>
		<category><![CDATA[Tag]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=35</guid>
		<description><![CDATA[This app will tell you what&#8217;s your Chinese name is. You can search the name database to find out, and then save it as your favorite. You can display it as a name tag to tell everybody your Chinese name with customized colors!Features:- Search from 7500+ English names.- Save as favorite name to be displayed [...]]]></description>
			<content:encoded><![CDATA[<img src="http://kooworx.com/blog/wp-content/uploads/2009/08/CNIcon.jpg" alt="Your Chinese Name Tag" /><br /><br />This app will tell you what&#8217;s your Chinese name is. You can search the name database to find out, and then save it as your favorite. You can display it as a name tag to tell everybody your Chinese name with customized colors!<br /><br />Features:<br /><br />- Search from 7500+ English names.<br />- Save as favorite name to be displayed later.<br />- Show your English or Chinese name as a name tag.<br />- Customize the colors of your name tag.<br /><br />New names will be added constantly via updates. <br /><br /><div id="attachment_25" class="wp-caption alignnone" style="width: 126px"><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=327025021&#038;mt=8"><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/appStore.jpg" alt="App Store" title="appStore" width="116" height="40" class="size-full wp-image-25" /></a><p class="wp-caption-text">App Store</p></div><br /><span id="more-35"></span><br /><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/CNDefault.jpg" alt="Your Chinese Name Tag" /><br /><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/CN1.jpg" alt="Your Chinese Name Tag" /><br /><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/CN2.jpg" alt="Your Chinese Name Tag" /><br /><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/CN3.jpg" alt="Your Chinese Name Tag" /><br /><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/CN4.jpg" alt="Your Chinese Name Tag" /><br /><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/CN5.jpg" alt="Your Chinese Name Tag" />]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/08/25/app-your-chinese-name-tag/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>App &#8211; Gallery Of Tina</title>
		<link>http://kooworx.com/blog/2009/08/18/app-gallery-of-tina/</link>
		<comments>http://kooworx.com/blog/2009/08/18/app-gallery-of-tina/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 03:17:14 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[Chinese]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Girl]]></category>
		<category><![CDATA[Sale]]></category>
		<category><![CDATA[Tina]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=24</guid>
		<description><![CDATA[oday, our app Chinese Girl &#8211; Gallery Of Tina is Ready For Sale, please visit our app page to check it out! Click Here to go!]]></description>
			<content:encoded><![CDATA[<div id="attachment_16" class="wp-caption alignnone" style="width: 110px"><a href="http://kooworx.com/chinese-girl-gallery-of-tina/"><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/GalleryOfTina100x100.jpg" alt="Gallery Of Tina" title="GalleryOfTina100x100" width="100" height="100" class="size-full wp-image-16" border="0" /></a><p class="wp-caption-text">Gallery Of Tina</p></div>Today, our app Chinese Girl &#8211; Gallery Of Tina is Ready For Sale, please visit our app page to check it out! <a href="http://kooworx.com/chinese-girl-gallery-of-tina/">Click Here</a> to go!<br /><br /><div id="attachment_25" class="wp-caption alignnone" style="width: 126px"><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=325328497&#038;mt=8"><img src="http://kooworx.com/blog/wp-content/uploads/2009/08/appStore.jpg" alt="App Store" title="appStore" width="116" height="40" class="size-full wp-image-25" /></a><p class="wp-caption-text">App Store</p></div>]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/08/18/app-gallery-of-tina/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Prevent iPhone From Sleeping</title>
		<link>http://kooworx.com/blog/2009/07/30/prevent-iphone-from-sleeping/</link>
		<comments>http://kooworx.com/blog/2009/07/30/prevent-iphone-from-sleeping/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 13:00:46 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[Game]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[sleeping]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=15</guid>
		<description><![CDATA[If your game do not require the user to interactive with the touch screen, say for example you only use accelerometer for moving your sprite. You&#8217;ll notice that the iPhone will go sleeping after a while. We don&#8217;t like this, so, you can add this to prevent it from sleeping:&#160;Objective-C&#160;&#124;&#160;&#160;copy&#160;code&#160;&#124;?&#160;1[UIApplication sharedApplication].idleTimerDisabled = YES;<br />That will be [...]]]></description>
			<content:encoded><![CDATA[If your game do not require the user to interactive with the touch screen, say for example you only use accelerometer for moving your sprite. You&#8217;ll notice that the iPhone will go sleeping after a while. We don&#8217;t like this, so, you can add this to prevent it from sleeping:<br /><br /><pre class="devcodeblock" title="Objective-C"><table class="devcodetools"><tbody><tr><td>&nbsp;Objective-C&nbsp;|&nbsp;</td><td style="background-image:url('http://kooworx.com/blog/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard2" src="http://kooworx.com/blog/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline">[UIApplication sharedApplication].idleTimerDisabled = YES;</pre></td></tr></table></div></pre>
<br />That will be all.<br />]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/07/30/prevent-iphone-from-sleeping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>imageNamed and imageWithContentsOfFile</title>
		<link>http://kooworx.com/blog/2009/07/27/imagenamed-and-imagewithcontentsoffile/</link>
		<comments>http://kooworx.com/blog/2009/07/27/imagenamed-and-imagewithcontentsoffile/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 04:09:36 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[imageNamed]]></category>
		<category><![CDATA[imageWithContentsOfFile]]></category>
		<category><![CDATA[Instruments]]></category>
		<category><![CDATA[simulator]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=14</guid>
		<description><![CDATA[In my last project, I used more than 100 images. It&#8217;s OK while I was testing it on the simulator. But when I uploaded it onto the device, it crashed all the time. I check the crash log, it showed as &#8220;low memory&#8221;.I used this to load image:&#160;Objective-C&#160;&#124;&#160;&#160;copy&#160;code&#160;&#124;?&#160;1singleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@&#34;test.jpg&#34;]];<br />When I run [...]]]></description>
			<content:encoded><![CDATA[In my last project, I used more than 100 images. It&#8217;s OK while I was testing it on the simulator. But when I uploaded it onto the device, it crashed all the time. I check the crash log, it showed as &#8220;low memory&#8221;.<br /><br />I used this to load image:<br /><br /><pre class="devcodeblock" title="Objective-C"><table class="devcodetools"><tbody><tr><td>&nbsp;Objective-C&nbsp;|&nbsp;</td><td style="background-image:url('http://kooworx.com/blog/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard5" src="http://kooworx.com/blog/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=5&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline">singleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@&quot;test.jpg&quot;]];</pre></td></tr></table></div></pre>
<br />When I run it with Instruments, I noticed that the use of the memory were increasing very fast and seemed to be not released. That's why the app crashed and through out a 101 error. It looks like that the imageNamed will cache images in the memory and only release the memory while the app terminate. Then I use imageWithContentsOfFile for a replacement of imageNamed:<br /><br /><pre class="devcodeblock" title="Objective-C"><table class="devcodetools"><tbody><tr><td>&nbsp;Objective-C&nbsp;|&nbsp;</td><td style="background-image:url('http://kooworx.com/blog/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard6" src="http://kooworx.com/blog/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=6&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline">NSString* str = [[NSBundle mainBundle] pathForResource:@&quot;test.jpg&quot; ofType:nil inDirectory:@&quot;&quot;];</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">2</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">singleImageView = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:str]];</pre></td></tr><tr><td class="devcodelines" width="1%">3</td><td class="devcodelinesarea"><pre class="devcode devcodeline"></pre></td></tr></table></div></pre>
<br />The problem solved! You can see the snapshot of Instruments below, the memory were released when I changed to another category.<br /><br /><img alt="" src="http://kooworx.com/blog/wp-content/uploads/2009/07/0727-instruments-1.jpg" title="Instruments snapshot" class="aligncenter" width="301" height="53" /><br /><br />The imageWithContentsOfFile might be slower than imageNamed, but it is worthy to use it.]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/07/27/imagenamed-and-imagewithcontentsoffile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To Be Compatible With OS 3.0</title>
		<link>http://kooworx.com/blog/2009/07/26/to-be-compatible-with-os-3-0/</link>
		<comments>http://kooworx.com/blog/2009/07/26/to-be-compatible-with-os-3-0/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 07:53:48 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[compatible]]></category>
		<category><![CDATA[OS 2.2]]></category>
		<category><![CDATA[OS 3.0]]></category>
		<category><![CDATA[systemVersion]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=9</guid>
		<description><![CDATA[While, as we all know, OS 3.0 has been installed or upgraded on most of the iPhones, but, there are still a lot of iPod Touch not upgraded. So, by now, we still need to develop our apps based on the OS 2.2+ then try to make it compatible with OS 3.0.When we test our [...]]]></description>
			<content:encoded><![CDATA[While, as we all know, OS 3.0 has been installed or upgraded on most of the iPhones, but, there are still a lot of iPod Touch not upgraded. So, by now, we still need to develop our apps based on the OS 2.2+ then try to make it compatible with OS 3.0.<br /><br />When we test our apps on OS 2.2+ and OS 3.0, we found out that some thing different in the two platforms, so if your want the same code to be built for different OS, here is the trick to do it.<br /><br /><pre class="devcodeblock" title="Objective-C"><table class="devcodetools"><tbody><tr><td>&nbsp;Objective-C&nbsp;|&nbsp;</td><td style="background-image:url('http://kooworx.com/blog/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard10" src="http://kooworx.com/blog/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=10&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">01</td><td class="devcodelinesarea"><pre class="devcode devcodeline">- (void)viewDidLoad {</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">02</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">&nbsp;</pre></td></tr><tr><td class="devcodelines" width="1%">03</td><td class="devcodelinesarea"><pre class="devcode devcodeline">#ifdef __IPHONE_3_0</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">04</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">	NSInteger offset = -40;</pre></td></tr><tr><td class="devcodelines" width="1%">05</td><td class="devcodelinesarea"><pre class="devcode devcodeline">#else</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">06</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">	NSInteger offset = 0;</pre></td></tr><tr><td class="devcodelines" width="1%">07</td><td class="devcodelinesarea"><pre class="devcode devcodeline">#endif</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">08</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">&nbsp;</pre></td></tr><tr><td class="devcodelines" width="1%">09</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	/* Your code here */</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">10</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">&nbsp;</pre></td></tr><tr><td class="devcodelines" width="1%">11</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	[super viewDidLoad];</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">12</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">}</pre></td></tr></table></div></pre>
<br />You can notice that we used pre-processor directives for the conditional compilation. But there is still a problem: we have to build two binaries for the different OS. What if we want to build only one binary that can be compatible with both platforms?<br /><br />This code will do it for you:<span id="more-9"></span><br /><br /><pre class="devcodeblock" title="Objective-C"><table class="devcodetools"><tbody><tr><td>&nbsp;Objective-C&nbsp;|&nbsp;</td><td style="background-image:url('http://kooworx.com/blog/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard11" src="http://kooworx.com/blog/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=11&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">01</td><td class="devcodelinesarea"><pre class="devcode devcodeline">- (void)viewDidLoad {</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">02</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"> </pre></td></tr><tr><td class="devcodelines" width="1%">03</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	NSString *version = [[UIDevice currentDevice] systemVersion];</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">04</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"> </pre></td></tr><tr><td class="devcodelines" width="1%">05</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	int offset = -40;</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">06</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"> </pre></td></tr><tr><td class="devcodelines" width="1%">07</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	if ([version isEqualToString:@&quot;2.2&quot;] || [version isEqualToString:@&quot;2.2.1&quot;]) {</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">08</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">		offset = 0;</pre></td></tr><tr><td class="devcodelines" width="1%">09</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	}</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">10</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">&nbsp;</pre></td></tr><tr><td class="devcodelines" width="1%">11</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	/* Your code here */</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">12</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"> </pre></td></tr><tr><td class="devcodelines" width="1%">13</td><td class="devcodelinesarea"><pre class="devcode devcodeline">	[super viewDidLoad];</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">14</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">}</pre></td></tr></table></div></pre>
<br />This code will detect the <strong>systemVersion</strong> of the OS, then we can get one binary to run on different OS.<br /><br />For another usage, you can use this:<br /><br /><pre class="devcodeblock" title="Objective-C"><table class="devcodetools"><tbody><tr><td>&nbsp;Objective-C&nbsp;|&nbsp;</td><td style="background-image:url('http://kooworx.com/blog/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard12" src="http://kooworx.com/blog/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=12&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline">float version = [[[UIDevice currentDevice] systemVersion] floatValue];</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">2</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">if (version &gt;= 3.0)</pre></td></tr><tr><td class="devcodelines" width="1%">3</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    {</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">4</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">    // iPhone 3.0 code here</pre></td></tr><tr><td class="devcodelines" width="1%">5</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    }</pre></td></tr></table></div></pre>
<br />]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/07/26/to-be-compatible-with-os-3-0/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Online today</title>
		<link>http://kooworx.com/blog/2009/07/15/online-today/</link>
		<comments>http://kooworx.com/blog/2009/07/15/online-today/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 04:08:21 +0000</pubDate>
		<dc:creator>kooworx</dc:creator>
				<category><![CDATA[kooworx]]></category>

		<guid isPermaLink="false">http://kooworx.com/blog/?p=5</guid>
		<description><![CDATA[Hi folks, this is the very first post in this newly created blog. We&#8217;ll put some stuff about what happened during our development of iPhone applications.&#160;Objective-C&#160;&#124;&#160;&#160;copy&#160;code&#160;&#124;?&#160;1NSLog(@&#34;Hello world from kooworx&#34;);]]></description>
			<content:encoded><![CDATA[Hi folks, this is the very first post in this newly created blog. We&#8217;ll put some stuff about what happened during our development of iPhone applications.<br /><br /><pre class="devcodeblock" title="Objective-C"><table class="devcodetools"><tbody><tr><td>&nbsp;Objective-C&nbsp;|&nbsp;</td><td style="background-image:url('http://kooworx.com/blog/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard14" src="http://kooworx.com/blog/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=14&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline">NSLog(@&quot;Hello world from kooworx&quot;);</pre></td></tr></table></div></pre>]]></content:encoded>
			<wfw:commentRss>http://kooworx.com/blog/2009/07/15/online-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
