<?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; How-to</title>
	<atom:link href="http://just2us.com/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://just2us.com</link>
	<description>Its about us</description>
	<lastBuildDate>Tue, 10 Aug 2010 17:16:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Building Your Own iPhone Static Library/Framework</title>
		<link>http://just2us.com/2010/08/building-your-own-iphone-static-libraryframework/</link>
		<comments>http://just2us.com/2010/08/building-your-own-iphone-static-libraryframework/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 17:16:11 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/08/building-your-own-iphone-static-libraryframework/</guid>
		<description><![CDATA[It is good programmer practice to build your very own framework. As a programmer, you would find certain tasks often the same across multiple projects. You might have experienced these before – writing (or copy-paste) the same code to perform certain function, creating projects using a similar framework/design, or reusing some common UI components. If [...]]]></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%2F08%2Fbuilding-your-own-iphone-static-libraryframework%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F08%2Fbuilding-your-own-iphone-static-libraryframework%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>It is good programmer practice to build your very own framework.</p>
<p>As a programmer, you would find certain tasks often the same across multiple projects. You might have experienced these before – writing (or copy-paste) the <strong>same</strong> code to perform certain function, creating projects using a <strong>similar</strong> framework/design, or reusing some <strong>common</strong> UI components. </p>
<p>If you have experienced the above, it is a good time to build your own framework. </p>
<p>There are many benefits to doing so:</p>
<ul>
<li>Once you started your own framework, you would be more conscious of where a piece of code belongs to.</li>
<li>Maintaining and fixing the framework will benefit <em>all projects</em> that use it.</li>
<li>You can send the static library and headers to others, without giving them the source code. This is also the same way <a href="http://developer.admob.com/wiki/IPhone">Admob</a> and <a href="http://www.flurry.com/">Flurry</a> are sending their libraries to developers.</li>
<li>You will be able to test your framework and demo how to use it.</li>
</ul>
<p>I have been wanting to build my own framework for a long time, but has been delaying.</p>
<p>But as I seek to create more iPhone apps in the coming days, I know I need to create my own framework to become more productive.</p>
<p>&#160;</p>
<h2>How to do so?</h2>
<p>Firstly, the solution does not belong to me. </p>
<p>I searched on the Internet on how to create your own framework, or static library, and there are a number of articles that came up. But I couldn’t find in <em>a single article </em>for what I wanted.</p>
<p>I merely wanted 2 things:</p>
<ol>
<li>Create a project that encompass both a framework and a demo app.</li>
<li>Simple and illustrated way to create a universal static library.</li>
</ol>
<p>There are 2 separate articles that will achieve what I wanted, when combined. Hence, my guide here will simply be made up of 2 steps by following the 2 articles, and the final step on how to use the static library.</p>
<p>&#160;</p>
<h2>Step 1 – Create Project from a Static Library Template</h2>
<p>Follow the instructions from <a href="http://jeffreysambells.com/iphone-os-static-library-template/" class="broken_link">iPhone OS Static Library Template by Jeffrey Sambells</a>. </p>
<p>Jeffrey Sambells article is helpful as he provided a Xcode template, with clear instructions on how you can create your library. </p>
<p>Not only does the template has a target for a static library, it also includes a target for building an iPhone app. This allows the programmer to create test cases for the static library and also demonstrating how to use the framework, all in the same project.</p>
<p>&#160;</p>
<h2>Step 2 – Creating a Universal Build</h2>
<p>In Step 1, you would have created a project that builds your static library. </p>
<p>You may follow the guide in Jeffrey Sambells’ article on how to use the static library (basically includes the project in another project), but there is a better way if you follow this step.</p>
<p>(There is a disadvantage if you follow the guide in Jeffrey Sambells’ article – you will not be able to distribute the static library to others.)</p>
<p>Instead, from the same project you created in Step 1, continue and follow the instructions from <a href="http://www.drobnik.com/touch/2010/04/universal-static-libraries/">Universal Static Library by Dr Touch</a>.</p>
<p>One important aspect of Dr Touch’s article is that it combines the library for both simulator and device, and merge them as a single universal build. In other words, it builds a fat binary that works for arm6, arm7 and i386 (for simulator). </p>
<p>After following the instructions from Dr Touch’s article (working on the same project from Step 1), you should have a similar project structure to mine.</p>
<p><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="Xcode JDLibrary" border="0" alt="Xcode JDLibrary" src="http://just2us.com/site/wp-content/uploads/2010/08/XcodeJDLibrary_thumb.png" width="391" height="510" /></p>
<p>&#160;</p>
<h2>Step 3 – Using the static library</h2>
<p>To use the static library, find the ZIP file that is produced.</p>
<p>Unzip it, and place them in a project that you will be working on. Or send the ZIP file to a developer!</p>
<p>That’s it! </p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/08/building-your-own-iphone-static-libraryframework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pitfall in using default values in settings bundle</title>
		<link>http://just2us.com/2010/08/pitfall-in-using-default-values-in-settings-bundle/</link>
		<comments>http://just2us.com/2010/08/pitfall-in-using-default-values-in-settings-bundle/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 16:00:12 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[pitfall]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/08/pitfall-in-using-default-values-in-settings-bundle/</guid>
		<description><![CDATA[If you are implementing application settings using iPhone’s Application Preferences, then you will want to take note of this pitfall. Referring to the schema reference for PSTextFieldSpecifier, you would notice that there is a DefaultValue key. You might thought that this key is to return a default value, when the preference is not set. In [...]]]></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%2F08%2Fpitfall-in-using-default-values-in-settings-bundle%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F08%2Fpitfall-in-using-default-values-in-settings-bundle%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you are implementing application settings using iPhone’s <a href="http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/Preferences/Preferences.html">Application Preferences</a>, then you will want to take note of this pitfall.</p>
<p>Referring to the <a href="http://developer.apple.com/iphone/library/documentation/PreferenceSettings/Conceptual/SettingsApplicationSchemaReference/Articles/PSTextFieldSpecifier.html#//apple_ref/doc/uid/TP40007011-SW1">schema reference for PSTextFieldSpecifier</a>, you would notice that there is a <strong>DefaultValue</strong> key. You might thought that this key is to return a default value, when the preference is not set.</p>
<p>In terms of code, you might thought that myvalue would return the default value.</p>
</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>myvalue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSUserDefaults</span> standardUserDefaults<span style="color: #002200;">&#93;</span> stringForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;mykey&quot;</span><span style="color: #002200;">&#93;</span></pre></div></div>

</p>
<p>But no, that is NOT the case. myvalue will always return nil, until you go to the Application Preferences page. In order to read a default value correctly, you will have to do more.</p>
<p>Refer to <a href="http://developer.apple.com/iphone/library/samplecode/AppPrefs/Introduction/Intro.html">AppPrefs Sample Code</a> on how that can be done. The code is copied here for reference.</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>testValue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSUserDefaults</span> standardUserDefaults<span style="color: #002200;">&#93;</span> stringForKey<span style="color: #002200;">:</span>kFirstNameKey<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>testValue <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span>
	<span style="color: #002200;">&#123;</span>
		<span style="color: #11740a; font-style: italic;">// no default values have been set, create them here based on what's in our Settings bundle info</span>
		<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>pathStr <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span> bundlePath<span style="color: #002200;">&#93;</span>;
		<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>settingsBundlePath <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>pathStr stringByAppendingPathComponent<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Settings.bundle&quot;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>finalPath <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>settingsBundlePath stringByAppendingPathComponent<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Root.plist&quot;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>settingsDict <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDictionary</span> dictionaryWithContentsOfFile<span style="color: #002200;">:</span>finalPath<span style="color: #002200;">&#93;</span>;
		<span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>prefSpecifierArray <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>settingsDict objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;PreferenceSpecifiers&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>firstNameDefault;
&nbsp;
		<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>prefItem;
		<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span>prefItem <span style="color: #a61390;">in</span> prefSpecifierArray<span style="color: #002200;">&#41;</span>
		<span style="color: #002200;">&#123;</span>
			<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>keyValueStr <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>prefItem objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Key&quot;</span><span style="color: #002200;">&#93;</span>;
			<span style="color: #a61390;">id</span> defaultValue <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>prefItem objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;DefaultValue&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
			<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>keyValueStr isEqualToString<span style="color: #002200;">:</span>kFirstNameKey<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
			<span style="color: #002200;">&#123;</span>
				firstNameDefault <span style="color: #002200;">=</span> defaultValue;
			<span style="color: #002200;">&#125;</span>
			<span style="color: #11740a; font-style: italic;">// Handle for other preferences you might have</span>
			<span style="color: #11740a; font-style: italic;">// ...</span>
		<span style="color: #002200;">&#125;</span>
&nbsp;
		<span style="color: #11740a; font-style: italic;">// since no default values have been set (i.e. no preferences file created), create it here		</span>
		<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>appDefaults <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDictionary</span> dictionaryWithObjectsAndKeys<span style="color: #002200;">:</span>
										firstNameDefault, kFirstNameKey,
										<span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSUserDefaults</span> standardUserDefaults<span style="color: #002200;">&#93;</span> registerDefaults<span style="color: #002200;">:</span>appDefaults<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSUserDefaults</span> standardUserDefaults<span style="color: #002200;">&#93;</span> synchronize<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #11740a; font-style: italic;">// we're ready to do, so lastly set the key preference values</span>
	firstName <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSUserDefaults</span> standardUserDefaults<span style="color: #002200;">&#93;</span> stringForKey<span style="color: #002200;">:</span>kFirstNameKey<span style="color: #002200;">&#93;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/08/pitfall-in-using-default-values-in-settings-bundle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>3</slash:comments>
		</item>
		<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>2</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>1</slash:comments>
		</item>
		<item>
		<title>How to resolve force close caused by Market</title>
		<link>http://just2us.com/2010/05/how-to-resolve-force-close-caused-by-market/</link>
		<comments>http://just2us.com/2010/05/how-to-resolve-force-close-caused-by-market/#comments</comments>
		<pubDate>Sat, 01 May 2010 07:36:06 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/05/how-to-resolve-force-close-caused-by-market/</guid>
		<description><![CDATA[This is an issue where an application that is opened from Android’s Market might encounter a force close. txeet had the same issue: &#160; This is due to the application having two launcher components, and Market is confused and therefore not able to launch. Strangely, some phones do not face the same problem. Though 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%2F05%2Fhow-to-resolve-force-close-caused-by-market%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F05%2Fhow-to-resolve-force-close-caused-by-market%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This is an <a href="http://code.google.com/p/android/issues/detail?id=6579">issue</a> where an application that is opened from Android’s Market might encounter a force close. <a href="http://txeet.com">txeet</a> had the same issue:</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/05/txeetforceclose.png"><img title="txeet force close" 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="txeet force close" src="http://just2us.com/site/wp-content/uploads/2010/05/txeetforceclose_thumb.png" width="292" border="0" /></a>&#160;</p>
<p>This is due to the application having two launcher components, and Market is confused and therefore not able to launch. Strangely, some phones do not face the same problem. </p>
<p>Though this is a bug on Android side, the application can <a href="http://stackoverflow.com/questions/2244781/after-downloading-an-application-with-two-launcher-components-from-the-marketplac">resolve</a> by simply adding a line in the manifest file.</p>
<blockquote><p>&lt;activity-alias android:name=&quot;com.android.internal.app.ResolverActivity&quot; android:targetActivity=&quot;.Main&quot; android:exported=&quot;true&quot;/&gt;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/05/how-to-resolve-force-close-caused-by-market/feed/</wfw:commentRss>
		<slash:comments>1</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 register US iTunes Account</title>
		<link>http://just2us.com/2010/02/how-to-register-us-itunes-account/</link>
		<comments>http://just2us.com/2010/02/how-to-register-us-itunes-account/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 15:17:10 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/02/how-to-register-us-itunes-account/</guid>
		<description><![CDATA[If you have a non-US iTunes account, and would like to download some US-only content, you need to do this. It is easy to register for another account, and you do NOT need another email address (if you use gmail), you do NOT need a US credit card, you do NOT need to stay in [...]]]></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-register-us-itunes-account%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F02%2Fhow-to-register-us-itunes-account%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you have a <strong>non-US iTunes</strong> account, and would like to download some <strong>US-only content</strong>, you need to do this.</p>
<p>It is easy to register for another account, and</p>
<ul>
<li>you do NOT need another email address (if you use gmail),</li>
<li>you do NOT need a US credit card,</li>
<li>you do NOT need to stay in US (for address)</li>
</ul>
<p>&#160;</p>
<h3>Follow these steps..</h3>
<p>In iTunes, go to App Store and click on a FREE app. </p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct1.jpg"><img title="Register-US-acct-1" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="396" alt="Register-US-acct-1" src="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct1_thumb.jpg" width="324" border="0" /></a></p>
<p>&#160;</p>
<p>Create a new account.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct2.jpg"><img title="Register-US-acct-2" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="336" alt="Register-US-acct-2" src="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct2_thumb.jpg" width="524" border="0" /></a>&#160; </p>
<p>Continue, accept the terms, and continue (no screenshots provided)..</p>
<p>Fill in the account details. Note that we used a trick here. Let’s say your real email is <a href="mailto:jason.bourne@gmail.com">jason.bourne@gmail.com</a>, then you can register <a href="mailto:jason.bourne+1@gmail.com">jason.bourne+1@gmail.com</a>. The verification email will be sent to your real email!</p>
<p>You can use +1, +800 or +dog. This is a gmail feature and might not work for other email providers.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct4.jpg"><img title="Register-US-acct-4" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="423" alt="Register-US-acct-4" src="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct4_thumb.jpg" width="644" border="0" /></a> </p>
<p>Click Continue.</p>
<p>In the next screen, select None for Credit Card (if you have not follow the first step, you will not see None option). Many of the fields are required and will be validated eg. 7-digit number. You could enter some bogus US address. One way is to go to maps.google.com and search for Starbucks in US.</p>
<p><a href="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct3.jpg"><img title="Register-US-acct-3" 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="Register-US-acct-3" src="http://just2us.com/site/wp-content/uploads/2010/02/RegisterUSacct3_thumb.jpg" width="556" border="0" /></a></p>
<p>&#160;</p>
<p>Click Continue.</p>
<p>Almost done. iTunes will send you an email for verification. It will be sent to your real email eg. <a href="mailto:jason.bourne@gmail.com">jason.bourne@gmail.com</a>. </p>
<p>Click on the verification link, login and you are done!</p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/02/how-to-register-us-itunes-account/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to redeem promo code</title>
		<link>http://just2us.com/2010/02/how-to-redeem-promo-code/</link>
		<comments>http://just2us.com/2010/02/how-to-redeem-promo-code/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 13:25:25 +0000</pubDate>
		<dc:creator>samwize</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://just2us.com/2010/02/how-to-redeem-promo-code/</guid>
		<description><![CDATA[To use promo code from iTunes, go to Home &#62; Redeem (under Quick Links) &#62; enter the promo code.]]></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-redeem-promo-code%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjust2us.com%2F2010%2F02%2Fhow-to-redeem-promo-code%2F&amp;source=samwize&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>To use promo code from iTunes, go to <strong>Home</strong> &gt; <strong>Redeem</strong> (under Quick Links) &gt; <strong>enter the promo code</strong>.</p>
<p align="center"><a href="http://just2us.com/site/wp-content/uploads/2010/02/Redeem1.jpg"><img title="Redeem1" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="373" alt="Redeem1" src="http://just2us.com/site/wp-content/uploads/2010/02/Redeem1_thumb.jpg" width="644" border="0" /></a> </p>
<p align="center"><a href="http://just2us.com/site/wp-content/uploads/2010/02/Redeem2.png"><img title="Redeem2" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="256" alt="Redeem2" src="http://just2us.com/site/wp-content/uploads/2010/02/Redeem2_thumb.png" width="644" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://just2us.com/2010/02/how-to-redeem-promo-code/feed/</wfw:commentRss>
		<slash:comments>1</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>
	</channel>
</rss>
