<?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>Just2us &#187; iPhone</title>
	<atom:link href="http://just2us.com/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://just2us.com</link>
	<description>Its about us</description>
	<lastBuildDate>Sat, 31 Jul 2010 16:03:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>I cut my own Micro SIM</title>
		<link>http://just2us.com/2010/07/i-cut-my-own-micro-sim/</link>
		<comments>http://just2us.com/2010/07/i-cut-my-own-micro-sim/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 15:37:05 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/07/i-cut-my-own-micro-sim/</guid>
		<description><![CDATA[I refuse to pay an extra $20, for a smaller SIM card. With dignity, I cut my Singtel standard SIM card to fit for my iPhone 4. &#160; As you can see, it is not hard. Just cut around the metal piece.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjust2us.com%2F2010%2F07%2Fi-cut-my-own-micro-sim%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F07%2Fi-cut-my-own-micro-sim%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I refuse to pay an extra $20, for a smaller SIM card. </p>
<p>With dignity, I cut my Singtel standard SIM card to fit for my iPhone 4.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/07/diymicrosim.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="diy-micro-sim" border="0" alt="diy-micro-sim" src="http://just2us.com/site/wp-content/uploads/2010/07/diymicrosim_thumb.jpg" width="324" height="456" /></a>&#160; </p>
</p>
<p>As you can see, it is not hard. Just cut around the metal piece.</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/07/i-cut-my-own-micro-sim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pitfalls of NSFetchedResultsController</title>
		<link>http://just2us.com/2010/02/pitfalls-of-nsfetchedresultscontroller/</link>
		<comments>http://just2us.com/2010/02/pitfalls-of-nsfetchedresultscontroller/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 14:06:59 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CoreData]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/02/pitfalls-of-nsfetchedresultscontroller/</guid>
		<description><![CDATA[I have recently used one of the most useful framework in iPhone 3.0 – CoreData. There are many guides on using CoreData, such as from cocoadevcentral or Apple’s guide. But what I found lacking is that there was no discussion on the pitfalls of using CoreData, or its view controller, NSFetchedResultsController. I learnt the pitfalls [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjust2us.com%2F2010%2F02%2Fpitfalls-of-nsfetchedresultscontroller%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F02%2Fpitfalls-of-nsfetchedresultscontroller%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have recently used one of the most useful framework in iPhone 3.0 – CoreData. </p>
<p>There are many guides on using CoreData, such as from <a href="http://cocoadevcentral.com/articles/000086.php">cocoadevcentral</a> or <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdBasics.html#//apple_ref/doc/uid/TP40001650-TP1">Apple’s guide</a>. But what I found lacking is that there was no discussion on the pitfalls of using CoreData, or its view controller, <a href="http://developer.apple.com/iphone/library/documentation/CoreData/Reference/NSFetchedResultsController_Class/Reference/Reference.html">NSFetchedResultsController</a>.</p>
<p>I learnt the pitfalls along the way, and there are 3 particular pitfalls that I would like to share with developers while developing <a href="http://txeet.com">txeet</a> for iPhone.</p>
<p>&#160;</p>
<h2>1. Performance hit with predicate using one-to-many relationship</h2>
<p>When using NSFetchedResultsController, we would often form our predicate (like SQL) to retrieve some table rows. </p>
<p>If you were to use a predicate that involves transversing a one-to-many relationship, the performance could be slowed down <a href="http://stackoverflow.com/questions/1145178/core-data-fetching-objects-that-are-in-relationship-to-another-object">tremendously</a> (as slow as 30 sec to run, or even crash!). Take for example a <strong>Template</strong> model that has a one-to-many relationship <strong>tags</strong> to <strong>Tag</strong> model:</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/coredatapitfallcode1.jpg"><img title="coredata pitfall code1" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="40" alt="coredata pitfall code1" src="http://just2us.com/site/wp-content/uploads/2010/02/coredatapitfallcode1_thumb.jpg" width="624" border="0" /></a>&#160; </p>
<p>The predicate above would require transversing to each Tag to find ‘love’. This is computationally <em>very expensive</em>. </p>
<p>The solution to this is to avoid transversing relationship. A faster way that CoreData could execute is to access the properties/attributes. For the above example, what I did is to add another attribute <strong>tagsAsAttribute</strong> to <strong>Template</strong> model. This property would store the tag names in a delimited format such as “;love;jokes;quotes;”. The predicate would then be changed to:</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/coredatapitfallcode2.jpg"><img title="coredata pitfall code2" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="31" alt="coredata pitfall code2" src="http://just2us.com/site/wp-content/uploads/2010/02/coredatapitfallcode2_thumb.jpg" width="679" border="0" /></a> </p>
<p>Note: This is not the best way to design the data model, as <strong>tagsAsAttribute</strong> has a dependency and is redundant.</p>
<p>&#160;</p>
<h2>2. User-driven updates</h2>
<p>If you read the <a href="http://developer.apple.com/iphone/library/documentation/CoreData/Reference/NSFetchedResultsControllerDelegate_Protocol/Reference/Reference.html">Apple’s guide to NSFetchedResultsControllerDelegate</a>, please note of the section User-Driven Updates.</p>
<p>In short, if you have user-driven updates, you should write the following as the first line in every (only one is shown below) of the NSFetchedResultsControllerDelegate delegate methods:</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/coredatapitfallcode3.jpg"><img title="coredata pitfall code3" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="37" alt="coredata pitfall code3" src="http://just2us.com/site/wp-content/uploads/2010/02/coredatapitfallcode3_thumb.jpg" width="557" border="0" /></a> </p>
<p>And when there is a user-driven update, set the <strong>isStillUpdating</strong> boolean to true, and set false when the update is completed.</p>
<p>User-driven updates could be re-ordering of table rows, or inserting of objects.</p>
<p>&#160;</p>
<h2>3. abort() should NEVER be used in release</h2>
<p>If you have used the sample code for CodeData, there is a line of code which is there only for testing environment. In the comments, it warned developers that <strong>abort()</strong> should not be used in shipping application..</p>
<p>But I didn’t read the comments..</p>
<p>Apparently, certain devices will occasionally have error when running certain CoreData methods. Eg. NSManagedObjectContext’s save. When there is an error, we could optionally handle the error, but we should NEVER abort and exit the app.</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/02/pitfalls-of-nsfetchedresultscontroller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hey AppVault! You copied my Broken Apple graphics!</title>
		<link>http://just2us.com/2010/01/hey-appvault-you-copied-my-broken-apple-graphics/</link>
		<comments>http://just2us.com/2010/01/hey-appvault-you-copied-my-broken-apple-graphics/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 19:04:14 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Interesting]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/01/hey-appvault-you-copied-my-broken-apple-graphics/</guid>
		<description><![CDATA[Late last night, we found out that AppVault has added a all-too-familiar-looking Broken Apple to their website – because AppBox complained that AppVault was too similar and infringed on their copyright. Here is the original website from AppVault: But if you go to the website now, you would see the below instead. Spot the differences? [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjust2us.com%2F2010%2F01%2Fhey-appvault-you-copied-my-broken-apple-graphics%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F01%2Fhey-appvault-you-copied-my-broken-apple-graphics%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Late last night, we found out that <a href="http://www.app-vault.com/blog/app-removed-from-app-store-at-request-of-competition/" class="broken_link">AppVault</a> has added a all-too-familiar-looking Broken Apple to their website – because <a href="http://www.allaboutapps.net/">AppBox</a> complained that <a href="http://www.app-vault.com/blog/app-removed-from-app-store-at-request-of-competition/" class="broken_link">AppVault</a> was too similar and infringed on their copyright. Here is the <strong>original website</strong> from <a href="http://www.app-vault.com/blog/app-removed-from-app-store-at-request-of-competition/" class="broken_link">AppVault</a>:</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/01/AppVaultcopyrightedbroken.png"><img title="AppVault copyrighted broken" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="425" alt="AppVault copyrighted broken" src="http://just2us.com/site/wp-content/uploads/2010/01/AppVaultcopyrightedbroken_thumb.png" width="644" border="0" /></a> </p>
<p>But if you go to the website now, you would see the below instead. Spot the differences?</p>
</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/01/AppVaultwithoutbrokenapple.png"><img title="AppVault without broken apple" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="395" alt="AppVault without broken apple" src="http://just2us.com/site/wp-content/uploads/2010/01/AppVaultwithoutbrokenapple_thumb.png" width="644" border="0" /></a> </p>
</p>
<p>Hmmm.. they took away MY BROKEN APPLE graphics! I am fine with you infringing <a href="http://www.just2me.com/2008/11/apple-itunes-is-broken.html">my copyright</a>, just give me due credits, can?</p>
<p align="center"><a href="http://just2us.com/site/wp-content/uploads/2010/01/AppVaultcomment.png"><img title="AppVault comment" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="501" alt="AppVault comment" src="http://just2us.com/site/wp-content/uploads/2010/01/AppVaultcomment_thumb.png" width="612" border="0" /></a> </p>
<p>@AppVault, can you not silently drop my case? You don’t just remove an infringed material from your <strike>App Store</strike> blog just because you can :p</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/01/hey-appvault-you-copied-my-broken-apple-graphics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why I don&#8217;t think much of Nexus One</title>
		<link>http://just2us.com/2010/01/why-i-dont-think-much-of-nexus-one/</link>
		<comments>http://just2us.com/2010/01/why-i-dont-think-much-of-nexus-one/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 15:47:25 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[market]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/01/why-i-dont-think-much-of-nexus-one/</guid>
		<description><![CDATA[It is just another Android phone. Tomorrow, there is going to be another big phone release by HTC or Samsung or Motorola or Sony Ericsson or LG or ZTE or Acer or Lenovo or Google.. And it is going to be dubbed the iPhone killer, again. From the view as a mobile fanboy or developer: [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjust2us.com%2F2010%2F01%2Fwhy-i-dont-think-much-of-nexus-one%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F01%2Fwhy-i-dont-think-much-of-nexus-one%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>It is just another Android phone.</p>
<p>Tomorrow, there is going to be another big phone release by <em>HTC or Samsung or Motorola or Sony Ericsson or LG or ZTE or Acer or Lenovo or Google..</em></p>
<p>And it is going to be dubbed the iPhone killer, again.</p>
<p>From the view as a mobile fanboy or developer:</p>
<blockquote><p>The more Android handsets there are, the more fragmented is the ecosystem, the <em>better</em> it is for iPhone.</p>
</blockquote>
<p>&#160;</p>
<p><a href="http://www.youtube.com/watch?v=I6COwgigJ-g"><img title="nexus web phone" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="246" alt="nexus web phone" src="http://just2us.com/site/wp-content/uploads/2010/01/nexuswebphone.jpg" width="260" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/01/why-i-dont-think-much-of-nexus-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone overtook Symbian in mobile market shares</title>
		<link>http://just2us.com/2009/10/mobile-os-share-2009-q3/</link>
		<comments>http://just2us.com/2009/10/mobile-os-share-2009-q3/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 16:01:19 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://just2us.com/2009/10/mobile-os-share-2009-q3/</guid>
		<description><![CDATA[The chart below compares the mobile operating system market in a period of 6 months &#8211; Feb vs Aug. More details can be found in Admob Aug 09 report. It is exciting to note the shifts between the market leaders. iPhone has switched with Symbian, and is now the market leader. Android has switched with [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjust2us.com%2F2009%2F10%2Fmobile-os-share-2009-q3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2009%2F10%2Fmobile-os-share-2009-q3%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The chart below compares the mobile operating system market in a period of 6 months &#8211; Feb vs Aug. More details can be found in <a href="http://metrics.admob.com/2009/09/august-2009-mobile-metrics-report/">Admob Aug 09 report</a>.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2009/10/OS-Market-2009-Q3.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="296" alt="OS Market 2009 Q3" src="http://just2us.com/site/wp-content/uploads/2009/10/OS-Market-2009-Q3_thumb.jpg" width="454" border="0"></a></p>
<p>It is exciting to note the shifts between the market leaders.</p>
<p>iPhone has switched with Symbian, and is now the market leader.</p>
<p>Android has switched with Windows, and is now just behind RIM.</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2009/10/mobile-os-share-2009-q3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
