<?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; Development</title>
	<atom:link href="http://just2us.com/category/development/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>How to use MapKit</title>
		<link>http://just2us.com/2010/05/how-to-use-mapkit/</link>
		<comments>http://just2us.com/2010/05/how-to-use-mapkit/#comments</comments>
		<pubDate>Sat, 22 May 2010 16:15:52 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[mapkit]]></category>

		<guid isPermaLink="false">http://just2us.com/?p=393</guid>
		<description><![CDATA[Apple seems to lack a MapKit programming guide. I have to look through the MapKit reference, search on the Internet, and read blog articles in order to do a few simple tasks with MapKit. I thought it would be great if there is a MapKit programming guide, similar to the Push Notification Service programming guide [...]]]></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%2F05%2Fhow-to-use-mapkit%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F05%2Fhow-to-use-mapkit%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Apple seems to lack a MapKit programming guide. I have to look through the MapKit reference, search on the Internet, and read blog articles in order to do a <em>few simple tasks</em> with MapKit.</p>
<p>I thought it would be great if there is a MapKit programming guide, similar to the <a href="http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html">Push Notification Service programming guide</a> provided by Apple. </p>
<p>But there isn’t. So I am here writing one for developers who are interested to use MapKit for that <em>few simple tasks</em>. This post contains 8 code snippets for 8 tasks.</p>
<p>&#160;</p>
<h4>1. Adding a map view</h4>
<p>If you simply want to add a map to your view, simply create a MKMapView object and insert it. That’s our first big step!</p>
</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidLoad <span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>super viewDidLoad<span style="color: #002200;">&#93;</span>;
	<span style="color: #11740a; font-style: italic;">// Init our map view </span>
	mapView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MKMapView alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>self.view.bounds<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>self.view insertSubview<span style="color: #002200;">:</span>mapView atIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>&#160;</p>
<h4>2. Configuring the map</h4>
<p>With a map, you could now configure various aspects by setting the mapView properties. Examples below:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">	<span style="color: #11740a; font-style: italic;">// Set the map type such as Standard, Satellite, Hybrid</span>
	mapView.mapType <span style="color: #002200;">=</span> MKMapTypeStandard;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Config user interactions</span>
	mapView.zoomEnabled <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
	mapView.scrollEnabled <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Set the region and zoom level</span>
	MKCoordinateRegion region;
	MKCoordinateSpan span;
	CLLocationCoordinate2D location;
	location.latitude <span style="color: #002200;">=</span> <span style="color: #2400d9;">1.302851</span>; <span style="color: #11740a; font-style: italic;">// Singapore!</span>
	location.longitude <span style="color: #002200;">=</span> <span style="color: #2400d9;">103.85523</span>;
	span.latitudeDelta <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.02</span>;
	span.longitudeDelta <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.02</span>;
	region.span <span style="color: #002200;">=</span> span;
	region.center <span style="color: #002200;">=</span> location;
	<span style="color: #11740a; font-style: italic;">// Set to that region with an animated effect</span>
	<span style="color: #002200;">&#91;</span>mapView setRegion<span style="color: #002200;">:</span>region animated<span style="color: #002200;">:</span>TRUE<span style="color: #002200;">&#93;</span>;
	<span style="color: #11740a; font-style: italic;">// Lastly, set the MKMapViewDelegate (we will use this later) </span>
	mapView.delegate <span style="color: #002200;">=</span> self;</pre></div></div>

<p>&#160;</p>
<h4>3. Showing the user&#8217;s location</h4>
<p>To show the user&#8217;s location on the map, we set this one special property.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">	mapView.showsUserLocation <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;</pre></div></div>

</p>
<p>&#160;</p>
<h4>4. Creating custom annotations/landmarks</h4>
<p>If you want to display some landmarks, aka annotations, on the map, you will need to create your annotation class that implement the MKAnnotation protocols. </p>
<p>Say you want to display some shops on the map, this is want you would do. </p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// ShopAnnotation.h</span>
<span style="color: #a61390;">@interface</span> ShopAnnotation <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> &lt;mkannotation&gt; <span style="color: #002200;">&#123;</span>
	Shop <span style="color: #002200;">*</span>shop; <span style="color: #11740a; font-style: italic;">// Assuming this class contains info about a shop</span>
<span style="color: #002200;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// ShopAnnotation.m	</span>
<span style="color: #11740a; font-style: italic;">// Required to implement</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CLLocationCoordinate2D<span style="color: #002200;">&#41;</span>coordinate <span style="color: #002200;">&#123;</span>
	CLLocationCoordinate2D theCoordinate;
	theCoordinate.latitude <span style="color: #002200;">=</span> shop.latitude;
	theCoordinate.longitude <span style="color: #002200;">=</span> shop.longitude;
	<span style="color: #a61390;">return</span> theCoordinate; 
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Optional</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>title <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> shop.name;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Optional</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>subtitle <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> shop.address;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>&#160;</p>
<h4>5. Adding annotations to the map</h4>
<p>To add the annotations to the map, you would create the ShopAnnotation earlier and add them to mapView.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">	<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span>Shop <span style="color: #002200;">*</span>shop <span style="color: #a61390;">in</span> allMyShops<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		ShopAnnotation <span style="color: #002200;">*</span>shopAnnotation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>ShopAnnotation alloc<span style="color: #002200;">&#93;</span> initWithShop<span style="color: #002200;">:</span>shop<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>mapView addAnnotation<span style="color: #002200;">:*</span>shopAnnotation <span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span></pre></div></div>

<p>&#160;</p>
<h4>6. Handling the annotation views</h4>
<p>Annotations are not views. After you added your annotations to the map, you would still need to provide its views. The mapView delegate methods will be called to ask for your annotations’ VIEWS. You will need to create the view and return it for mapView to display. </p>
<p>In our example, we create a MKPinAnnotationView, which is a standard pin that you see in Maps app. You could otherwise create your custom view that extends MKAnnotationView.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>MKAnnotationView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>mapView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>MKMapView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>theMapView viewForAnnotation<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span> &lt;mkannotation&gt;<span style="color: #002200;">&#41;</span>annotation <span style="color: #002200;">&#123;</span>
	<span style="color: #11740a; font-style: italic;">// If it's the user location, just return nil.</span>
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>annotation isKindOfClass<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>MKUserLocation class<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
		<span style="color: #a61390;">return</span> <span style="color: #a61390;">nil</span>;
	<span style="color: #11740a; font-style: italic;">// If it is our ShopAnnotation, we create and return its view</span>
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>annotation isKindOfClass<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>ShopAnnotation class<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #11740a; font-style: italic;">// try to dequeue an existing pin view first</span>
		<span style="color: #a61390;">static</span> <span style="color: #400080;">NSString</span><span style="color: #002200;">*</span> shopAnnotationIdentifier <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;ShopAnnotationIdentifier&quot;</span>;
		MKPinAnnotationView<span style="color: #002200;">*</span> pinView <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span>MKPinAnnotationView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span>mapView dequeueReusableAnnotationViewWithIdentifier<span style="color: #002200;">:</span>shopAnnotationIdentifier <span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span>pinView<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
			<span style="color: #11740a; font-style: italic;">// If an existing pin view was not available, create one</span>
			MKPinAnnotationView<span style="color: #002200;">*</span> customPinView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MKPinAnnotationView alloc<span style="color: #002200;">&#93;</span> initWithAnnotation<span style="color: #002200;">:</span>annotation reuseIdentifier<span style="color: #002200;">:</span>shopAnnotationIdentifier<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
			customPinView.pinColor <span style="color: #002200;">=</span> MKPinAnnotationColorRed;
			customPinView.animatesDrop <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
			customPinView.canShowCallout <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
&nbsp;
			<span style="color: #11740a; font-style: italic;">// add a detail disclosure button to the callout which will open a new view controller page</span>
			UIButton<span style="color: #002200;">*</span> rightButton <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIButton buttonWithType<span style="color: #002200;">:</span>UIButtonTypeDetailDisclosure<span style="color: #002200;">&#93;</span>;
			customPinView.rightCalloutAccessoryView <span style="color: #002200;">=</span> rightButton;
&nbsp;
			<span style="color: #a61390;">return</span> customPinView;
		<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
			pinView.annotation <span style="color: #002200;">=</span> annotation;
		<span style="color: #002200;">&#125;</span>&lt;strike&gt;&lt;<span style="color: #002200;">/</span>strike&gt;&lt;strike&gt;&lt;<span style="color: #002200;">/</span>strike&gt;
		<span style="color: #a61390;">return</span> pinView;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>&#160; </p>
<h4>7. Selecting a pin</h4>
<p>When a user selects a pin and press the UIButtonTypeDetailDisclosure button within the callout, we can present more details about the annotation. Implement another MKMapViewDelegate to handle this.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>mapView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>MKMapView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>_mapView annotationView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>MKAnnotationView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>view calloutAccessoryControlTapped<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIControl <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>control <span style="color: #002200;">&#123;</span>
	<span style="color: #11740a; font-style: italic;">// Handle it, such as showing another view controller</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>&#160;</p>
<h4>8. Open Maps app</h4>
<p>If want to provide a route from the user location to the selected annotation, you would need the help of iPhone’s Maps app. This means that your app will exit and Maps app will be opened, with you telling Maps the source and destination to route.</p>
<p>You can open Maps with the schema as such.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>url <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://maps.google.com/maps?saddr=%f,%f&amp;amp;daddr=%f,%f&quot;</span>;, userLatitude, userLongitude, <span style="color: #002200;">&#91;</span>shop.latitude floatValue<span style="color: #002200;">&#93;</span>, <span style="color: #002200;">&#91;</span>shop.longitude floatValue<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> openURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span>url<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>&#160;</p>
<p>With that, we have come to the end of <em>a few simple tasks</em> with MapKit!</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/05/how-to-use-mapkit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to highlight code syntax in WordPress</title>
		<link>http://just2us.com/2010/05/how-to-highlight-code-syntax-in-wordpress/</link>
		<comments>http://just2us.com/2010/05/how-to-highlight-code-syntax-in-wordpress/#comments</comments>
		<pubDate>Sat, 22 May 2010 15:41:29 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://just2us.com/?p=384</guid>
		<description><![CDATA[WP-Syntax is the answer. For example, this is how I highlight an iPhone’s Objective-C code in this post. - &#40;void&#41;viewDidLoad &#123;     &#91;super viewDidLoad&#93;;     NSString *title = &#91;NSString stringWithFormat:@&#34;My %@ syntax&#34;, @&#34;AWESOME&#34;&#93;;     self.title = title; &#125;   To use WP-Syntax, simply surround the code with &#60;pre lang=”LANGUAGE”&#62; and &#60;/pre&#62;, where LANGUAGE is the [...]]]></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%2F05%2Fhow-to-highlight-code-syntax-in-wordpress%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F05%2Fhow-to-highlight-code-syntax-in-wordpress%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a> is the answer.</p>
<p>For example, this is how I highlight an iPhone’s Objective-C code in this post.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidLoad   
<span style="color: #002200;">&#123;</span>    
    <span style="color: #002200;">&#91;</span>super viewDidLoad<span style="color: #002200;">&#93;</span>;    
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>title <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;My %@ syntax&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;AWESOME&quot;</span><span style="color: #002200;">&#93;</span>;    
    self.title <span style="color: #002200;">=</span> title;    
<span style="color: #002200;">&#125;</span></pre></div></div>

<p> <br />
To use <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a>, simply surround the code with &lt;pre lang=”LANGUAGE”&gt; and &lt;/pre&gt;, where LANGUAGE is the programming language.</p>
<p>To find out what to use for LANGUAGE, look under supported languages <a href="http://wordpress.org/extend/plugins/wp-syntax/other_notes/">here</a>.
</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/05/how-to-highlight-code-syntax-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s technically new for SG 4D?</title>
		<link>http://just2us.com/2010/04/whats-technically-new-for-sg-4d/</link>
		<comments>http://just2us.com/2010/04/whats-technically-new-for-sg-4d/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 05:24:26 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[SG 4D]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/04/whats-technically-new-for-sg-4d/</guid>
		<description><![CDATA[In the previous post, I have highlighted what’s new for SG 4D. In this post, I will be highlighting what’s new, from a technical point of view. I am excited to write what is technically new in the app, as there are aplenty, and we have used many awesome technology from iPhone 3.0 SDK, including [...]]]></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%2F04%2Fwhats-technically-new-for-sg-4d%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F04%2Fwhats-technically-new-for-sg-4d%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In the <a href="http://just2us.com/2010/03/whats-new-for-sg-4d/">previous post</a>, I have highlighted what’s new for SG 4D. In this post, I will be highlighting what’s new, from a technical point of view.</p>
<p>I am excited to write what is technically new in the app, as there are aplenty, and we have used many awesome technology from iPhone 3.0 SDK, including CoreData, In-app purchase, Facebook Connect library, etc..</p>
<p><span id="more-366"></span></p>
<h3>1. Google’s AppEngine</h3>
<p>I lied. Not only did we use awesome technology from iPhone, we used awesome technology from Google!</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto;" src="http://just2us.com/site/wp-content/uploads/2010/03/appengine4d.png" alt="" /></p>
<p>The server side is now completely powered by Google’s <a href="http://code.google.com/appengine/">AppEngine</a>. This brings about several benefits: cheap/free server hosting, scalable architecture, stable+distributed+fast servers.</p>
<p>The process of retrieving 4D results is also technically more sound, using REST with JSON, and a proper cron job for web crawling. This makes me happier and sleeps better.</p>
<h3>2. Core Data</h3>
<p>Not only the server application is improved, the client application too, with another awesome technology!</p>
<p>In short, Core Data is the iPhone 3.0 SDK framework for managing data (or commonly databases). The list of features and benefits can be found <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdTechnologyOverview.html">here</a>.</p>
<p>What Core Data meant for SG 4D is that <strong>all the results</strong>, <em>I meant all 24 years of results</em>, are easily stored and queried using the framework.</p>
<p>No longer is your analysis of a 4D number done on the server side. When you asked to analysis a 4D number, your iPhone will query the large set of data using Core Data, and give you the analysis instantly!</p>
<p>This also means more advance analysis is possible in the future!</p>
<h3>3. In-App Purchase</h3>
<p>In-App Purchase is the ability to purchase items right from the app. This is a breakthrough for iPhone 3.0.</p>
<p>In SG 4D, you can now purchase/unlock the Premium Features immediately. Hence, it is not needed to download a lite version, and subsequently upgrading to a paid version.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/04/PurchasePremiumFeatures.png"><img style="display: inline; border: 0px;" title="Purchase Premium Features" src="http://just2us.com/site/wp-content/uploads/2010/04/PurchasePremiumFeatures_thumb.png" border="0" alt="Purchase Premium Features" width="164" height="244" /></a></p>
<p>We have also simplified the purchasing of the Premium Features by just having a $3.99 purchase to get all the features, including future features such as push notification!</p>
<h3>4. Copy-and-paste</h3>
<p>In iPhone 3.0, the <em>most awesome</em> feature should be none other than copy-and-paste (pun intended).</p>
<p>In SG 4D, you could now copy and the 4D results, and paste it anywhere – SMS, Email, twitter, etc..</p>
<p>To make things easier, we also added functions to Email and SMS to your friends.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/04/Email.png"><img style="display: inline; margin: 0px 10px 0px 0px; border: 0px;" title="Email" src="http://just2us.com/site/wp-content/uploads/2010/04/Email_thumb.png" border="0" alt="Email" width="164" height="244" /></a> <img style="margin: 0px 0px 0px 10px;" src="http://just2us.com/site/wp-content/uploads/2010/03/SMS_thumb.png" alt="" /></p>
<h3>5. Wallpaper Selection</h3>
<p>You are now able to select your favorite wallpaper that goes along with the 4D results!</p>
<p>You might have noticed that the minimum OS requirement is now 3.1 (instead of 3.0). This is due to one of the SDK API we used for selecting, resizing and cropping your photo.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/04/Wallpaper.png"><img style="display: inline; border: 0px;" title="Wallpaper" src="http://just2us.com/site/wp-content/uploads/2010/04/Wallpaper_thumb.png" border="0" alt="Wallpaper" width="164" height="244" /></a></p>
<p><em>Anyway, the photo above is my 3 hour old nephew, born on March 31, 2010 (Wed). And my dad strike 3rd prize, even before using him for wallpaper (:</em></p>
<h3>6. Sharing on Facebook</h3>
<p>Facebook Connect for iPhone is a library for integrating apps with Facebook.</p>
<p>For SG 4D, you could now set your status to help to share SG 4D app with your friends. Right now, we know this is nothing much.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/04/Facebookpost.jpg"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="Facebook post" src="http://just2us.com/site/wp-content/uploads/2010/04/Facebookpost_thumb.jpg" border="0" alt="Facebook post" width="404" height="70" /></a></p>
<p>In the future, we are thinking you could post status, such as “I strike 1st prize!”, “Bought 1234 for this wed, sat and sun”, etc.. If you have any idea on better use for Facebook with SG 4D, we are happy to hear.</p>
<h3>7. Reviewing on AppStore</h3>
<p>We would like you to review the app, no matter good or bad.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/04/Review.png"><img style="display: inline; border: 0px;" title="Review" src="http://just2us.com/site/wp-content/uploads/2010/04/Review_thumb.png" border="0" alt="Review" width="164" height="244" /></a></p>
<p>To help you to help us review, we have added a function under More to bring you right to App Store to write a review.</p>
<p>In addition, 14 days after you installed the app, SG 4D will prompt you to rate and review us.</p>
<h3>Conclusion</h3>
<p>SG 4D version 2 is a big overhaul, technically more sound, and has promising future.</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/04/whats-technically-new-for-sg-4d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What to do if WordPress is not displaying UTF-8 correctly?</title>
		<link>http://just2us.com/2010/03/what-to-do-if-wordpress-is-not-displaying-utf-8-correctly/</link>
		<comments>http://just2us.com/2010/03/what-to-do-if-wordpress-is-not-displaying-utf-8-correctly/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 17:51:37 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/03/what-to-do-if-wordpress-is-not-displaying-utf-8-correctly/</guid>
		<description><![CDATA[A while ago, this blog was not showing correctly some chinese (UTF-8) characters. It was due to the WordPress that I have set up using a wrong character set. It was using latin1 instead of UTF-8. To solve the problem, you could go to phpMyAdmin, and run the following SQLs. Note: Change wrdp1 to your [...]]]></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%2F03%2Fwhat-to-do-if-wordpress-is-not-displaying-utf-8-correctly%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F03%2Fwhat-to-do-if-wordpress-is-not-displaying-utf-8-correctly%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A while ago, this blog was not showing correctly some chinese (UTF-8) characters.</p>
<p>It was due to the WordPress that I have set up using a wrong character set. It was using latin1 instead of UTF-8.</p>
<p>To solve the problem, you could go to phpMyAdmin, and run the following SQLs.    <br />Note: Change wrdp1 to your wordpress database name accordingly.</p>
<p><font face="Courier">ALTER TABLE wrdp1.wp_comments CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;     <br />ALTER TABLE wrdp1.wp_links CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_options CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_postmeta CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_posts CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_terms CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_term_relationships CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_term_taxonomy CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_usermeta CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;      <br />ALTER TABLE wrdp1.wp_users CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;</font> </p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/03/phpmyadmin.png"><img title="phpmyadmin" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="239" alt="phpmyadmin" src="http://just2us.com/site/wp-content/uploads/2010/03/phpmyadmin_thumb.png" width="606" border="0" /></a></p>
<p>The result should be like the table above. </p>
<p>But note that we are not able to recover any UTF-8 characters that were in a post before this operation. You would need to edit the post, enter the correct UTF-8, and save.</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/03/what-to-do-if-wordpress-is-not-displaying-utf-8-correctly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to prompt user to review your iPhone app</title>
		<link>http://just2us.com/2010/02/how-to-prompt-user-to-review-your-iphone-app/</link>
		<comments>http://just2us.com/2010/02/how-to-prompt-user-to-review-your-iphone-app/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 10:30:26 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/02/how-to-prompt-user-to-review-your-iphone-app/</guid>
		<description><![CDATA[Apple’s app review is flawed – when users delete an app, it ask to rate. But if users like an app, it does not ask to rate. That is bias. If a user did not delete your app, it should not be a worthless app and should have a positive review. As a developer, we [...]]]></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%2Fhow-to-prompt-user-to-review-your-iphone-app%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F02%2Fhow-to-prompt-user-to-review-your-iphone-app%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Apple’s app review is flawed – when users delete an app, it ask to rate. But if users like an app, it <em>does not </em>ask to rate. That is bias.</p>
<p>If a user did not delete your app, it should not be a worthless app and should have a positive review. As a developer, we should prompt users to rate and comment an app after using it a number of times. </p>
<p><a href="http://txeet.com"><img title="rate txeet" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="484" alt="rate txeet" src="http://just2us.com/site/wp-content/uploads/2010/02/ratetxeet.png" width="324" border="0" /></a></p>
<p>&#160;</p>
<p> <span id="more-283"></span>
<p>What we can do is to detect that the app has started a number of times, and show a polite prompt to the user to ask him to rate the app. If user choose to rate the app, he will be redirected to App Store to rate and comment.</p>
<p>I am not directly providing the code to do that, as Arashpayan has done that excellently.</p>
<p>Arashpayan has written <a href="http://arashpayan.com/blog/index.php/2009/09/07/presenting-appirater/">Appirater</a> (read as Appi-rater). The code he provided at <a title="http://github.com/arashpayan/appirater/" href="http://github.com/arashpayan/appirater/">http://github.com/arashpayan/appirater/</a> works like a charm for <a href="http://txeet.com">txeet</a>.</p>
</p>
<p align="center"><a href="http://txeet.com">&#160;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/02/how-to-prompt-user-to-review-your-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to read iPhone crash log?</title>
		<link>http://just2us.com/2010/02/how-to-read-iphone-crash-log/</link>
		<comments>http://just2us.com/2010/02/how-to-read-iphone-crash-log/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 14:08:50 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/02/how-to-read-iphone-crash-log/</guid>
		<description><![CDATA[Many times, application crashes, and a developer will have no idea what is the cause (if he knows, it would not have happened). I am not providing the how-to here, instead I am referring to anoshkin’s blog post. One valuable lesson I learnt: Always keep the dSYM for each version released I did not know [...]]]></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%2Fhow-to-read-iphone-crash-log%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F02%2Fhow-to-read-iphone-crash-log%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Many times, application crashes, and a developer will have no idea what is the cause (<em>if he knows, it would not have happened</em>).</p>
<p>I am not providing the how-to here, instead I am referring to <a href="http://www.anoshkin.net/blog/2008/09/09/iphone-crash-logs/">anoshkin’s blog post</a>.</p>
<p>One valuable lesson I learnt: <strong>Always keep the dSYM for each version released</strong></p>
<p>I did not know that I should keep the dSYM, and when I need it, I don’t have it.. Bad.</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/02/how-to-read-iphone-crash-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Signs that App Store is getting crowded</title>
		<link>http://just2us.com/2010/02/sign-that-app-store-is-getting-crowded/</link>
		<comments>http://just2us.com/2010/02/sign-that-app-store-is-getting-crowded/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 14:39:49 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[appstore]]></category>
		<category><![CDATA[market]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/02/sign-that-app-store-is-getting-crowded/</guid>
		<description><![CDATA[txeet was released on 9 Feb 2010. Shortly after releasing, I checked on App Store ranking and my analytic data, and I see signs that Apple’s App Store is getting too crowded. &#160; Sign 1 – Apps cluttered in the categories, especially in Lifestyle In just a single day, there are 18 lifestyle apps released. [...]]]></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%2Fsign-that-app-store-is-getting-crowded%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F02%2Fsign-that-app-store-is-getting-crowded%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://txeet.com">txeet</a> was released on 9 Feb 2010. </p>
<p>Shortly after releasing, I checked on App Store ranking and my analytic data, and I see signs that Apple’s App Store is getting too crowded.</p>
<p>&#160;</p>
<p> <span id="more-273"></span><br />
<h2>Sign 1 – Apps cluttered in the categories, especially in Lifestyle</h2>
<p>In just a single day, there are <strong>18 lifestyle apps</strong> released. These apps are ordered in alphabetical order, therefore txeet is placed quite behind, in fact it is in page 2. </p>
<p>To have a newly released app in page 2 is a big disappointment. One year ago, it could take 3 days before a new app gets pushed to page 2. Those were the days..</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/lifestylerelease1.jpg"><img title="lifestyle-release1" 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="688" alt="lifestyle-release1" src="http://just2us.com/site/wp-content/uploads/2010/02/lifestylerelease1_thumb.jpg" width="360" border="0" /></a></p>
<p>Note that page 1 has 5 charm apps (similar apps with combination of color and types…). The developer probably gonna release another 100+ apps as there are so many colors..</p>
<p><img title="lifestyle-release2" 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="697" alt="lifestyle-release2" src="http://just2us.com/site/wp-content/uploads/2010/02/lifestylerelease2_thumb.jpg" width="360" border="0" /> </p>
</p>
<p>Page 2 has quite a lot of Girls apps, the latest trend. On first look, txeet looks bright and very out of place.</p>
<p>&#160;</p>
<p>&#160;</p>
<h2>Sign 2 – Analytics show that Android has more users</h2>
<p>I used Flurry analytics to analyze the <strong>number of new users </strong>for the first few days of launch.</p>
<p>Android was released on Oct 18th, and the first day it gathered <strong>620 new users</strong>.</p>
<h2><a href="http://just2us.com/site/wp-content/uploads/2010/02/txeetandroid.png"><img title="txeet android" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="194" alt="txeet android" src="http://just2us.com/site/wp-content/uploads/2010/02/txeetandroid_thumb.png" width="659" border="0" /></a></h2>
<p>&#160;</p>
<p>iPhone was released on Feb 9th, and the first full day it gathered <strong>147 new users</strong>. </p>
</p>
<h2><a href="http://just2us.com/site/wp-content/uploads/2010/02/txeetiphone.png"><img title="txeet iphone" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="197" alt="txeet iphone" src="http://just2us.com/site/wp-content/uploads/2010/02/txeetiphone_thumb.png" width="659" border="0" /></a> </h2>
<p>This post will be updated when I have updated data.</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/02/sign-that-app-store-is-getting-crowded/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>What are you working on?</title>
		<link>http://just2us.com/2010/01/what-are-you-working-on/</link>
		<comments>http://just2us.com/2010/01/what-are-you-working-on/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 13:54:00 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[txeet]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/01/what-are-you-working-on/</guid>
		<description><![CDATA[Some of you might be wondering – what are you working on? Is there new releases of SG 4D, SG Toto, SG Wireless, or some other new app? txeet, is what I am currently working on. In Oct 2009, txeet was first released on Android. Thereafter, I have been working on an iPhone version. This [...]]]></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%2Fwhat-are-you-working-on%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F01%2Fwhat-are-you-working-on%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Some of you might be wondering – what are you working on? Is there new releases of SG 4D, SG Toto, SG Wireless, or some other new app?</p>
<p><a href="http://txeet.com/">txeet</a>, is what I am currently working on. </p>
<p>In Oct 2009, txeet was <a href="http://txeet.com/2009/10/first-version-released/">first released</a> on Android. Thereafter, I have been working on an iPhone version. This screenshot is a preview:</p>
<p align="center"><a href="http://just2us.com/site/wp-content/uploads/2010/01/txeetpreview.png"><img title="txeet preview" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="txeet preview" src="http://just2us.com/site/wp-content/uploads/2010/01/txeetpreview_thumb.png" width="322" border="0" /></a></p>
<p>In Feb 2010, the first version for iPhone <em>should</em> be released. I’ll pray hard, to Apple for its release..</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/01/what-are-you-working-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SG 4D &#8211; Mobile website for all phones</title>
		<link>http://just2us.com/2010/01/sg-4d-mobile-website-for-all-phones/</link>
		<comments>http://just2us.com/2010/01/sg-4d-mobile-website-for-all-phones/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 16:21:02 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[AppEngine]]></category>
		<category><![CDATA[SG 4D]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/01/sg-4d-mobile-website-for-all-phones/</guid>
		<description><![CDATA[This is a little secret. I have created a mobile website for 4D results at http://sg4d.just2us.com/ There is nothing special about it, other than that it was built with Google’s App Engine. Running on Google’s infrastructure and servers has its bonuses – Google ensures stability, performance and scalability.]]></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%2Fsg-4d-mobile-website-for-all-phones%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F01%2Fsg-4d-mobile-website-for-all-phones%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This is a little secret. I have created a mobile website for 4D results at <a title="http://sg4d.just2us.com/" href="http://sg4d.just2us.com/">http://sg4d.just2us.com/</a></p>
<p>There is nothing special about it, other than that it was built with <a href="http://code.google.com/appengine/">Google’s App Engine</a>. Running on Google’s infrastructure and servers has its bonuses – Google ensures stability, performance and scalability.</p>
<p align="center"><a href="http://sg4d.just2us.com/"><img title="sgresult 4d" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="sgresult 4d" src="http://just2us.com/site/wp-content/uploads/2010/01/sgresult4d.png" width="243" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/01/sg-4d-mobile-website-for-all-phones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
