<?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>Arash Payan &#124; Blog &#187; Tutorials</title>
	<atom:link href="http://arashpayan.com/blog/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://arashpayan.com/blog</link>
	<description>(Place witty tagline here)</description>
	<lastBuildDate>Thu, 22 Sep 2011 06:43:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cheap iPhone data plan with T-Mobile USA</title>
		<link>http://arashpayan.com/blog/2009/08/25/cheap-iphone-data-plan-with-t-mobile-usa/</link>
		<comments>http://arashpayan.com/blog/2009/08/25/cheap-iphone-data-plan-with-t-mobile-usa/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 23:20:18 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[data plan]]></category>
		<category><![CDATA[tmobile]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=163</guid>
		<description><![CDATA[Just a quick post for everyone who&#8217;s lucky enough to be using T-Mobile on their iPhone in the US. It&#8217;s possible to get a data plan for your iPhone at only $9.99. It&#8217;s edge only, but that doesn&#8217;t matter because T-Mobile&#8217;s 3G network is incompatible with the iPhone&#8217;s 3G radio. Here it is: Log into [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post for everyone who&#8217;s lucky enough to be using T-Mobile on their iPhone in the US. It&#8217;s possible to get a data plan for your iPhone at only $9.99. It&#8217;s edge only, but that doesn&#8217;t matter because T-Mobile&#8217;s 3G network is incompatible with the iPhone&#8217;s 3G radio.</p>
<p>Here it is:</p>
<ol>
<li>Log into your account at tmobile.com. Change your device to be a silver (the pink one won&#8217;t work!) Motorola RAZR.</li>
<li> As of this writing, there&#8217;s a bug in the site that prevents you from seeing the correct data plans for your newly selected device, so log out of the site, then log back in again. Now fFind your way to the page that lists the possible services you can add on to your plan, and you should now be able to select a $9.99/month web plan ($20 gets you unlimited texting as well). Select it.</li>
<li>In your iPhone go to <code>Settings->General->Network->Cellular Data Network</code> and for the APN use <code>internet2.voicestream.com</code>. Leave the username and password blank.</li>
</ol>
<p>You might need to wait up to 24 hours for the service to be activated. Just keep restarting your phone periodically and check to see if it starts working.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2009/08/25/cheap-iphone-data-plan-with-t-mobile-usa/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>How To: Get a Video Screen Capture from Your iPhone</title>
		<link>http://arashpayan.com/blog/2009/08/15/how-to-get-a-video-screen-capture-from-your-iphone/</link>
		<comments>http://arashpayan.com/blog/2009/08/15/how-to-get-a-video-screen-capture-from-your-iphone/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 07:24:31 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=152</guid>
		<description><![CDATA[I just setup my iPhone so I can control it remotely and ultimately perform video captures of my activity on it. It&#8217;s a quick and painless process, and here&#8217;s a step by step for those interested: Jailbreak your iPhone/iPod Touch There are various tutorials around that take you through the jailbreaking process. Just make sure [...]]]></description>
			<content:encoded><![CDATA[<p>I just setup my iPhone so I can control it remotely and ultimately perform video captures of my activity on it. It&#8217;s a quick and painless process, and here&#8217;s a step by step for those interested:</p>
<ol>
<li><strong>Jailbreak your iPhone/iPod Touch</strong> There are <a href="http://www.iphonedownloadblog.com/2009/06/19/tutorial-jailbreak-your-iphone-3g-30-with-pwnagetool-for-mac/">various</a> <a href="http://blog.iphoneunlocking.com/2009/07/07/tutorial-jailbreak-iphone-3gs-using-redsn0w/">tutorials</a> around that take you through the jailbreaking process. Just make sure to use the <a href="http://thepiratebay.org/user/iphonedev/">latest version</a> of the jailbreaking tools and install Cydia if you&#8217;re prompted.</li>
<li><strong>Launch Cydia and install Veency</strong> If this is your first time opening up Cydia, you&#8217;ll be prompted about what mode you want the program to run in; select &#8216;User&#8217;. Next click on the <code>Sections</code> tab at the bottom, select the <code>Networking</code> section and scroll down until you see <code>Veency</code>. Select it and press Install.</li>
<li><strong>Download and install a VNC client</strong> If you&#8217;re on OS X,  you can download <a href="http://sourceforge.net/projects/cotvnc/">Chicken of the VNC</a>. On Windows, you can use <a href="http://www.tightvnc.com/">Tight VNC</a>.</li>
<li><strong>Find your iPhone&#8217;s IP address</strong> On your phone go to <code>Settings-&gt;Wi-Fi</code> then click the blue disclosure button for the network you&#8217;re logged into. Take note of your iPhone&#8217;s IP address, because we&#8217;ll need it later. Mine is <code>192.168.1.50</code>.</li>
<li><strong>Launch VNC and connect to your iPhone</strong> Make sure your iPhone is unlocked and logged into your Wi-Fi network. Launch Chicken of the VNC (or Tight VNC) from your desktop, type in your iPhone&#8217;s IP address for the <code>Host</code>, and leave the <code>Display</code> at 0, then hit Connect. You should see a prompt on your iPhone asking you to accept or reject the connection. <img src="http://arashpayan.com/blog/wp-content/uploads/2009/08/Veency_Prompt.PNG" alt="Veency Prompt" title="Veency Prompt" width="320" height="480" class="size-full wp-image-153" /><br/>Go ahead and accept.</li>
<li><strong>Control the iPhone</strong> You can control the iPhone with left-mouse clicks and the keyboard. You can simulate a press of the &#8216;Home&#8217; button with a right-mouse click, and you can simulate the &#8216;Sleep/Power&#8217; button with a middle-mouse click.</li>
<li><strong>Capture the iPhone screen</strong> I like to use <a href="http://www.telestream.net/screen-flow/">Screenflow</a> on my Mac to capture screencasts. I&#8217;m not up to date on the best screen capturing software for Windows, but I&#8217;m sure there are plenty of options out there.</li>
</ol>
<p>A couple caveats: The frame rate&#8217;s not that great, which produces some artifacts during animations, and any app that uses OpenGL doesn&#8217;t work at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2009/08/15/how-to-get-a-video-screen-capture-from-your-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the browser&#8217;s user agent with mod_python</title>
		<link>http://arashpayan.com/blog/2009/08/07/get-the-browsers-user-agent-with-mod_python/</link>
		<comments>http://arashpayan.com/blog/2009/08/07/get-the-browsers-user-agent-with-mod_python/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 20:54:22 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[mod_python]]></category>
		<category><![CDATA[psp]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[user-agent]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=145</guid>
		<description><![CDATA[I recently discovered the beauty of mod_python and python server pages (psp), and I&#8217;ve been slowly replacing the php code on my server as I make changes. One thing that took me awhile to figure out was how to get the user-agent of the requesting client. In the hopes of helping others in the same [...]]]></description>
			<content:encoded><![CDATA[<p>I recently discovered the beauty of <a href="http://onlamp.com/pub/a/python/2003/10/02/mod_python.html">mod_python</a> and <a href="http://onlamp.com/pub/a/python/2004/02/26/python_server_pages.html">python server pages (psp)</a>, and I&#8217;ve been slowly replacing the php code on my server as I make changes. One thing that took me awhile to figure out was how to get the user-agent of the requesting client. In the hopes of helping others in the same boat, here&#8217;s the line of code:</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">&lt;%= req.headers_in[<span style="color:#760f15;">'User-Agent'</span>] &nbsp;%&gt;</div>
<p><br/></p>
<p>As you can see all the request&#8217;s header information is in the <code>req.header_in</code> dictionary.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2009/08/07/get-the-browsers-user-agent-with-mod_python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>t-zones is even easier to setup now</title>
		<link>http://arashpayan.com/blog/2009/05/11/t-zones-is-even-easier-to-setup-now/</link>
		<comments>http://arashpayan.com/blog/2009/05/11/t-zones-is-even-easier-to-setup-now/#comments</comments>
		<pubDate>Tue, 12 May 2009 07:57:35 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[tzones]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=121</guid>
		<description><![CDATA[After restoring a family member&#8217;s iPhone that was acting up, I began setting up t-zones for them, but couldn&#8217;t find the t-zones hack in the BigBoss repository. After some experimenting, I soon realized that none of the proxy configuration work is required anymore either. Setting up t-zones on your iPhone is now an easy 3 [...]]]></description>
			<content:encoded><![CDATA[<p>After restoring a family member&#8217;s iPhone that was acting up, I began setting up t-zones for them, but couldn&#8217;t find the t-zones hack in the BigBoss repository. After some experimenting, I soon realized that none of the proxy configuration work is required anymore either. Setting up t-zones on your iPhone is now an easy 3 step process:</p>
<ol>
<li>Go to <code>Settings->General->Network->Cellular Data Network</code>
<li>Type <code>wap.voicestream.com</code> for the APN (leave the username and password) blank
<li>There&#8217;s no step 3!
</ol>
<p>That&#8217;s all there is to it. YouTube even works over t-zones now.</p>
<p>BTW, if you&#8217;re a long time T-Mobile customer, you can call in right now and ask about the loyal customer plan. If you&#8217;ve been with them long enough, you can have a plan which gives you unlimited minutes for only $50 a month.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2009/05/11/t-zones-is-even-easier-to-setup-now/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Installing iPhone firmware 2.1</title>
		<link>http://arashpayan.com/blog/2008/09/14/installing-iphone-firmware-21/</link>
		<comments>http://arashpayan.com/blog/2008/09/14/installing-iphone-firmware-21/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 22:35:42 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=39</guid>
		<description><![CDATA[Here&#8217;s a step by step on how to install the new 2.1 firmware using PwnageTool. I&#8217;m assuming that you&#8217;ve alread Pwned your phone before when you follow this tutorial. If you haven&#8217;t, the steps at the end may be a little different for you. Update to iTunes 8 and restart After the reboot, plug in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a step by step on how to install the new 2.1 firmware using <a href="http://blog.iphone-dev.org/post/49988701/pwnagetool-and-quickpwn-for-2-1-firmware">PwnageTool</a>. I&#8217;m assuming that you&#8217;ve alread Pwned your phone before when you follow this tutorial. If you haven&#8217;t, the steps at the end may be a little different for you.</p>
<ol>
<li>Update to iTunes 8 and restart
<li>After the reboot, plug in your phone, then open up iTunes. It will ask if you want to update your phone. Click &#8216;Download only&#8217;. If you accidentally clicked cancel, just click on your phone in the iTunes sidebar, then click &#8216;Update&#8217; to get the latest firmware. Then once the download starts, unplug your iPhone from the USB port.
<li>Once the download finishes, close iTunes
<li>Open up the &#8216;Activity Monitor&#8217; app from /Applications/Utilities. Find the &#8216;iTunes Helper&#8217; in the list of running programs and kill it (the red button at the top left).
<li>Set your phone&#8217;s auto-lock to never (Settings->General->Auto Lock->Never)
<li>After downloading PwnageTool and copying it to your /Applications folder, launch the program.
<li>Select your device (I&#8217;m using the original iPhone) and click the next arrow.
<li>PwnageTool will search for the ipsw firmware file you just downloaded (and it should find it). Select it and click the next arrow.
<li>Now PwnageTool will look for the bootloader v4.6 and 3.9 files. If you don&#8217;t have them, you can download them <a href="http://drop.io/zmyh83n">here</a>. After downloading the files, click &#8216;No&#8217; to searching the web for the bootloader file. At the next dialog, click &#8216;Yes&#8217; to browse for the location where you downloaded the file.
<li>Now PwnageTool will ask you if you have an iPhone contract that would normally activate through iTunes. If you are using the Apple approved carrier in your country, you can click &#8216;Yes&#8217;, and this will skip the unlocking process on your phone. Just say &#8216;No&#8217; if you want your phone unlocked.
<li>Now PwnageTool will build an ipsw file for your phone.
<li>After the file is created, close PwnageTool, disconnect and turn off your phone, and open up iTunes.
<li>Now we need to put the phone into recovery mode. While the phone is off, hold down the &#8216;Home&#8217; button, and at the same time plug your phone into your Mac. Keep holding down the &#8216;Home&#8217; button until iTunes tells you that your phone is in recovery mode and needs to be restored.
<li>In iTunes, hold down the option key and click &#8216;Restore.&#8217; Select the new firmware file that PwnageTool just created, and you should be good to go in about 10 minutes.
<li>Enjoy your updated phone!
</ol>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2008/09/14/installing-iphone-firmware-21/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open links from UIWebView in MobileSafari</title>
		<link>http://arashpayan.com/blog/2008/09/06/open-links-from-uiwebview-in-mobilesafari/</link>
		<comments>http://arashpayan.com/blog/2008/09/06/open-links-from-uiwebview-in-mobilesafari/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 08:13:39 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[mobilesafari]]></category>
		<category><![CDATA[uiwebview]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=37</guid>
		<description><![CDATA[If you&#8217;ve embedded a UIWebView in your iPhone/iPod app, you may not want the user to suffer through surfing all successive pages through it. Instead, you can open up your first page inside a UIWebView and any links the user tries to follow will instead open up in MobileSafari. All you need to do is [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve embedded a <code>UIWebView</code> in your iPhone/iPod app, you may not want the user to suffer through surfing all successive pages through it. Instead, you can open up your first page inside a <code>UIWebView</code> and any links the user tries to follow will instead open up in MobileSafari.</p>
<p>All you need to do is set the <code>UIWebView</code>&#8216;s delegate, to an object that implements the optional method <code>webView:shouldStartLoadWithRequest:navigationType:</code> (part of the <code>UIWebViewDelegate</code> protocol). Then whenever the initial page is loaded or a link is followed in that view, the delegate&#8217;s method will be called. You&#8217;ll want to return <code>YES</code> for the page you initially load, and then return <code>NO</code> for all others, and open the URL in MobileSafari. Here&#8217;s what the method implementation should look like:</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; ">- (<span style="color:#881350;">BOOL</span>)<span style="color:#6c0540;">webView:</span>(UIWebView *)webView<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#6c0540;">shouldStartLoadWithRequest:</span>(<span style="color:#400080;">NSURLRequest</span> *)request<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#6c0540;">navigationType:</span>(UIWebViewNavigationType)navigationType<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">if</span><span style="color:#003369;"> </span>([[[request <span style="color:#6c0540;">URL</span>] <span style="color:#6c0540;">absoluteString</span>] <span style="color:#6c0540;">isEqual:</span><span style="color:#760f15;">@&quot;http://arashpayan.com/myInitialPage/&quot;</span>])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">return</span> <span style="color:#881350;">YES</span>;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;[[UIApplication <span style="color:#6c0540;">sharedApplication</span>] <span style="color:#6c0540;">openURL:</span>[request <span style="color:#6c0540;">URL</span>]];<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">return</span> <span style="color:#881350;">NO</span>;<br />
}</div>
<p>By returning <code>NO</code> from the delegate method, we&#8217;re telling the web view not to load the link the user tapped, but instead we redirect the opening of the link to <code>[UIApplication openURL:]</code> (MobileSafari).</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2008/09/06/open-links-from-uiwebview-in-mobilesafari/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Change iPhone/iPod app orientation within a UITabBarController</title>
		<link>http://arashpayan.com/blog/2008/09/04/change-iphoneipod-app-orientation-within-a-uitabbarcontroller/</link>
		<comments>http://arashpayan.com/blog/2008/09/04/change-iphoneipod-app-orientation-within-a-uitabbarcontroller/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 23:59:33 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[uitabbarcontroller]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=25</guid>
		<description><![CDATA[The documentation for the official iPhone SDK is less than stellar, and as a result I&#8217;ve encountered lots of frustrating little problems. In particular, I wasn&#8217;t able to get my app to change its orientation when the phone was rotated. UIViewController has a method shouldAutorotateToInterfaceOrientation: that gets called when the iPhone/iPod orientation is changed by [...]]]></description>
			<content:encoded><![CDATA[<p>The documentation for the official iPhone SDK is less than stellar, and as a result I&#8217;ve encountered lots of frustrating little problems. In particular, I wasn&#8217;t able to get my app to change its orientation when the phone was rotated. <code>UIViewController</code> has a method <code>shouldAutorotateToInterfaceOrientation:</code> that gets called when the iPhone/iPod orientation is changed by the user, and overriding this method to return <code>YES</code> should cause your view to be rotated. You may have implemented this method and to your frustration, nothing happened when you rotated the device. The trick is that Cocoa only calls <code>shouldAutorotateToInterfaceOrientation:</code> on the top most <code>UIViewController</code>. Meaning if your program lives inside a <code>UITabBarController</code> (possibly with a <code>UINavigationController</code> inside some of the tab bar items), the <code>UIViewController</code> that the user is currently interacting with, is not necessarily the one receiving the method call.</p>
<p>In my app, everything lives inside a <code>UITabBarController</code>, so that&#8217;s what was receiving the <code>shouldAutorotateToInterfaceOrientation:</code> call. In order to get orientation changes to work you need to subclass <code>UITabBarController</code> (contrary to Apple doc recommendations) and override the method so you can return <code>YES</code> when it&#8217;s called. Below is some code for a simple <code>UITabBarController</code> subclass used inside a program that supports a horizontal view.</p>
<p>RotatingTabBarAppDelegate.h</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#683821;">#import &lt;UIKit/UIKit.h&gt;<br />
</span><br />
<span style="color:#683821;">#import &quot;RotatingTabBarController.h&quot;<br />
</span><br />
<span style="color:#236e25;">/*<br />
&nbsp;Nothing special implemented in our delegate for this example.<br />
&nbsp;*/</span><br />
<span style="color:#881350;">@class</span> RotatingTabBarAppViewController;</p>
<p><span style="color:#881350;">@interface</span> RotatingTabBarAppAppDelegate : <span style="color:#400080;">NSObject</span> &lt;UIApplicationDelegate&gt; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">IBOutlet</span> UIWindow *window;<br />
}</p>
<p><span style="color:#881350;">@property</span><span style="color:#003369;"> </span>(<span style="color:#881350;">nonatomic</span>, <span style="color:#ff0000;">retain</span>) UIWindow *window;</p>
<p><span style="color:#881350;">@end</span></div>
<p>RotatingTabBarAppDelegate.m</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#683821;">#import &quot;RotatingTabBarAppAppDelegate.h&quot;<br />
</span><br />
<span style="color:#881350;">@implementation</span> RotatingTabBarAppAppDelegate</p>
<p><span style="color:#881350;">@synthesize</span> window;</p>
<p><span style="color:#236e25;">/*<br />
&nbsp;We&#8217;ll programmatically lay out a simple GUI for this demonstration.<br />
&nbsp;*/</span><br />
- (<span style="color:#881350;">void</span>)<span style="color:#6c0540;">applicationDidFinishLaunching:</span>(UIApplication *)application { &nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#236e25;">// Just make two empty view controllers for fun<br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;UIViewController *tab1 = [[UIViewController <span style="color:#ff0000;">alloc</span>] <span style="color:#6c0540;">init</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;tab1.tabBarItem = [[UITabBarItem <span style="color:#ff0000;">alloc</span>] <span style="color:#6c0540;">initWithTabBarSystemItem:</span>UITabBarSystemItemTopRated <span style="color:#6c0540;">tag:</span><span style="color:#0000ff;">0</span>];</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;UIViewController *tab2 = [[UIViewController <span style="color:#ff0000;">alloc</span>] <span style="color:#6c0540;">init</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;tab2.tabBarItem = [[UITabBarItem <span style="color:#ff0000;">alloc</span>] <span style="color:#6c0540;">initWithTabBarSystemItem:</span>UITabBarSystemItemSearch <span style="color:#6c0540;">tag:</span><span style="color:#0000ff;">1</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#236e25;">// Now create an instance of our rotating tab bar controller<br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;RotatingTabBarController *tbc = [[RotatingTabBarController <span style="color:#ff0000;">alloc</span>] <span style="color:#6c0540;">init</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#236e25;">// Add the two view controllers to the tab bar<br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;[tbc <span style="color:#6c0540;">setViewControllers:</span>[<span style="color:#400080;">NSArray</span> <span style="color:#6c0540;">arrayWithObjects:</span>tab1, tab2, <span style="color:#881350;">nil</span>]];<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#236e25;">// Add the tab bar controller&#8217;s view to the window<br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;[window <span style="color:#6c0540;">addSubview:</span>tbc.view];<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#236e25;">// Make our program visible<br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;[window <span style="color:#6c0540;">makeKeyAndVisible</span>];<br />
}</p>
<p>
- (<span style="color:#881350;">void</span>)<span style="color:#6c0540;">dealloc</span> {<br />
&nbsp;&nbsp;&nbsp;&nbsp;[window <span style="color:#ff0000;">release</span>];<br />
&nbsp;&nbsp;&nbsp;&nbsp;[<span style="color:#881350;">super</span> <span style="color:#6c0540;">dealloc</span>];<br />
}</p>
<p>
<span style="color:#881350;">@end</span></div>
<p>RotatingTabBarController.h</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#683821;">#import &lt;UIKit/UIKit.h&gt;<br />
</span><br />
<span style="color:#236e25;">/*<br />
&nbsp;The subclass doesn&#8217;t need any new methods or members.<br />
&nbsp;*/</span><br />
<span style="color:#881350;">@interface</span> RotatingTabBarController : UITabBarController {</p>
<p>}</p>
<p><span style="color:#881350;">@end</span></div>
<p>RotatingTabBarController.m</p>
<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#683821;">#import &quot;RotatingTabBarController.h&quot;<br />
</span><br />
<span style="color:#881350;">@implementation</span> RotatingTabBarController</p>
<p><span style="color:#236e25;">/*<br />
&nbsp;Just override this single method to return YES when we want it to.<br />
&nbsp;*/</span><br />
- (<span style="color:#881350;">BOOL</span>)<span style="color:#6c0540;">shouldAutorotateToInterfaceOrientation:</span>(UIInterfaceOrientation)interfaceOrientation {<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#236e25;">// Always returning YES means the view will rotate to accomodate any orientation.<br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881350;">return</span> <span style="color:#881350;">YES</span>;<br />
}</p>
<p><span style="color:#881350;">@end</span></div>
<p>The one thing this doesn&#8217;t address, is when you only want certain views in your program to rotate. In that case you just need to make your <code>UITabBarController</code> ask the currently visible view controller in the program if the app should rotate, and return that <code>BOOL</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2008/09/04/change-iphoneipod-app-orientation-within-a-uitabbarcontroller/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>T-Zones on iPhone 2.0</title>
		<link>http://arashpayan.com/blog/2008/07/26/t-zones-on-iphone-20/</link>
		<comments>http://arashpayan.com/blog/2008/07/26/t-zones-on-iphone-20/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 21:04:35 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[tzones]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=20</guid>
		<description><![CDATA[If you&#8217;re trying to get T-Zones working on the iPhone 2.0 software, you don&#8217;t need to follow the old manual way of doing it. Just go into Cydia and search for &#8216;TZones Hack&#8217; (without the quotes) and install the BigBoss tweak that comes up. Restart your phone, and you&#8217;re good to go. As usual, the [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re trying to get T-Zones working on the iPhone 2.0 software, you don&#8217;t need to follow the <a href="http://arashpayan.com/blog/2007/09/17/t-zones-aka-599-internet-access-on-the-iphone/">old manual way</a> of doing it. Just go into Cydia and search for &#8216;TZones Hack&#8217; (without the quotes) and install the BigBoss tweak that comes up. Restart your phone, and you&#8217;re good to go.</p>
<p>As usual, the YouTube app still won&#8217;t work with this hack.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2008/07/26/t-zones-on-iphone-20/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Updating 1st gen iPhone to 2.0 software</title>
		<link>http://arashpayan.com/blog/2008/07/19/updating-1st-gen-iphone-to-20-software/</link>
		<comments>http://arashpayan.com/blog/2008/07/19/updating-1st-gen-iphone-to-20-software/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 05:12:24 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/index.php/2008/07/19/updating-1st-gen-iphone-to-20-software/</guid>
		<description><![CDATA[The new PwnageTool is out, and I&#8217;m gonna document my steps to install the 2.0 software on my 1st gen iPhone. Note that this is not an upgrade. The process will wipe your phone, so backup any pictures or notes that you may have on there. First thing&#8217;s first. Downoad the latest PwnageTool. Unzip the [...]]]></description>
			<content:encoded><![CDATA[<p>The new <a href="http://blog.iphone-dev.org/post/42858313/thanks-for-waiting">PwnageTool</a> is out, and I&#8217;m gonna document my steps to install the 2.0 software on my 1st gen iPhone. Note that this is not an upgrade. The process will wipe your phone, so backup any pictures or notes that you may have on there.</p>
<ol>
<li>First thing&#8217;s first. Downoad the latest <a href="http://www.hackint0sh.org/forum/mirror/PwnageTool_2.0.1.zip">PwnageTool</a>.
<li>Unzip the file and drop it in your /Applications folder
<li>Make sure you have the latest version of iTunes (Apple->Software Update). Start up iTunes after updating to make sure it starts.
<li>Plug in your iPhone, and iTunes will ask if you want to update your phone. Click &#8216;Download Only&#8217;. After it finishes downloading, close iTunes.
<li>Download the version 3.9 and 4.6 boot loaders. I used <a href="http://rapidshare.com/files/131008012/boot_loader.zip">this link</a>, but that link might not work after awhile. Extract the file (and extract the .zip file inside of it again) until you see the <code>bl39.bin</code> and <code>bl46.bin</code> files.
<li>After the download is finished, close iTunes.
<li>Open the &#8216;Activity Monitor&#8217; application. (/Applications/Utilities/Activity Monitor). Find the &#8216;iTunes Helper&#8217; process and force quit the program.
<li>Plug in your iPhone and turn off the auto lock. (Settings->General->Auto-Lock->Never)
<li>Launch PwnageTool, then click on the iPhone on the left.
<li>Select the 2.0 firmware that it finds (iPhone1,1_2.0_5A347)
<li>Pwnage tool should be able to find your boot loaders (mine were in my Documents directory). If not, make sure you&#8217;ve extracted the boot loader file you downloaded. Worst case, just browse for it manually.
<li>Pwnage will ask you if you&#8217;re legit. I use T-Mobile in America, so I clicked &#8216;No.&#8217;
<li>Pwnage may ask you for your admin password.
<li>Now it will ask if your phone has been &#8216;Pwned&#8217; before. I presume this is your first time (seeing as how the application just came out), so click &#8216;No&#8217;.
<li>This part is tricky. Watch the PwnageTool screen carefully as it will prompt you to press combinations of your Home and Power buttons in order to put the phone into DFU mode. It took me several times to do it, but just keep trying by following the on screen instructions. (When Pwnage says you have successfully entered DFU mode, your screen might be off. That&#8217;s ok)
<li>Once Pwnage tells you that you&#8217;re in DFU mode, open up iTunes. iTunes will say that the phone needs to be restored. Hold down the &#8216;option&#8217; key and click on the &#8216;Restore&#8217; button. iTunes will prompt you for the location of a firmware file. Select the one on the Desktop that PwnageTool created (iPhone1,1_2.0_5A347_Custom_Restore.ipsw).
<li>Go make yourself a cup of tea. :-) After the restore, the phone will reboot and Boot Neuter will flash the boot loader and base band. Your phone will reboot again, and you&#8217;re done!
</ol>
<p>If iTunes doesn&#8217;t immediately recognize your phone, try restarting iTunes. It seems the iTunes Helper is necessary for syncing the iPhone.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2008/07/19/updating-1st-gen-iphone-to-20-software/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>t-zones (a.k.a. $5.99 Internet access) on the iPhone</title>
		<link>http://arashpayan.com/blog/2007/09/17/t-zones-aka-599-internet-access-on-the-iphone/</link>
		<comments>http://arashpayan.com/blog/2007/09/17/t-zones-aka-599-internet-access-on-the-iphone/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 04:25:43 +0000</pubDate>
		<dc:creator>arash</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://arashpayan.com/blog/?p=10</guid>
		<description><![CDATA[UPDATE 3 (May 12, 2009): This tutorial and the two update links below it are outdated. Instead, setting up T-zones is now a super easy 30 second process. UPDATE 2 (July 26, 2008): There is a much easier way to set up T-Zones now. UPDATE: After going through my logs I&#8217;ve noticed that there are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE 3 (May 12, 2009):</strong> This tutorial and the two update links below it are outdated. Instead, setting up T-zones is now <a href="http://arashpayan.com/blog/index.php/2009/05/11/t-zones-is-even-easier-to-setup-now/">a super easy 30 second process.</a></p>
<p><strong>UPDATE 2 (July 26, 2008):</strong> There is a much <a href="http://arashpayan.com/blog/2008/07/26/t-zones-on-iphone-20/">easier way</a> to set up T-Zones now.</p>
<p><strong>UPDATE:</strong> After going through my logs I&#8217;ve noticed that there are a lot of Windows users checking out this guide. So I&#8217;ve added a step 0 to help them out.</p>
<p>I received my iPhone on Friday and immediately went about <a href="http://modmyiphone.com/wiki/index.php/IPhone_unlock_OS_X_Part_1">actvating and unlocking it</a>, and at the end of the tutorial, there&#8217;s a link to a <a href="http://www.hackint0sh.org/forum/showthread.php?t=6365">forum discussion</a> on getting t-zones working on your iPhone. After reading through it and placing a call to t-mobile&#8217;s customer support (great folks over there!) I finally got it working. Here are the steps needed in an easy to follow format.</p>
<p>I&#8217;m going to make a couple of assumptions in this tutorial.</p>
<ol>
<li>You have T-Mobile and t-zones</li>
<li>You installed OpenSSH on your iPhone (<a href="http://modmyiphone.com/wiki/index.php/IPhone_unlock_OS_X_Part_3">part 3</a> of the unlocking process</li>
<li>Your iPhone has Wi-Fi access.</li>
</ol>
<p>0) <em><strong>Windows users install WinSCP</strong></em> If you&#8217;re running Windows, install a file transfer client to move the files between your computer and your iPhone. I recommend <a href="http://www.winscp.net/">WinSCP</a>. If the tutorial makes anymore mention about transferring files between computers, just use WinSCP and connect to the IP of your iPhone. Set the protocol to be SSH/SSH2.</p>
<p>1) <em><strong>Turn off Auto-Lock</strong></em> Go to &#8216;Settings&#8217; -> &#8216;General&#8217; -> &#8216;Auto-Lock&#8217; and select &#8216;Never.&#8217; You can turn it back on after you&#8217;re done with this, but for now disable it.</p>
<p>2) <em><strong>Enter APN, username and password</strong></em> Go to &#8216;Settings&#8217; -> &#8216;General&#8217; -> &#8216;Network&#8217; -> &#8216;Edge.&#8217; For the <strong>APN</strong> field enter <em>wap.voicestream.com</em>. Make sure the <strong>username</strong> and <strong>password</strong> fields are empty.</p>
<p>3) <em><strong>Create proxy.pac</strong></em> Thanks to <a href="http://www.hackint0sh.org/forum/showthread.php?s=08de956de275c736532483549f6aed5e&#038;t=6365&#038;page=2">kdub3000 for the file contents</a>. Open TextEdit or your favorite text editor on Linux, and paste in the following code into a new document:</p>
<pre style="border: 1px solid ; margin: 0px; padding: 6px; overflow: auto; width: auto; height: auto">function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(), "10.0.0.0", "255.0.0.0"))
return "PROXY 216.155.165.50:8080";
else
return "DIRECT";
}</pre>
<p>Save the file to your Desktop as <code>proxy.pac</code>. On OS X, make sure TextEdit doesn&#8217;t append a .txt extension to the file.</p>
<p>4) <em><strong>Find the IP address of your iPhone</strong></em> Go to &#8216;Settings&#8217; -> &#8216;Wi-Fi&#8217;, and click on the blue dot next to the name of the network your iPhone is currently connected to (the one with the checkbox). Look at the IP address there and remember it or write it down.</p>
<p>5) <em><strong>Upload proxy.pac to the iPhone</strong></em> Now we need to copy proxy.pac to our iPhone&#8217;s <code>/private/var/root/</code> directory. If you know how to do this using a Cyberduck or any other file transfer program, feel free to do so. Otherwise open up a terminal (OS X, go to Applications -> Utilities -> Terminal.app) and enter the following command with the ip address of your iPhone substituted for the $IPHONE_IP:</p>
<pre style="border: 1px solid ; margin: 0px; padding: 6px; overflow: auto; width: auto; height: auto">scp ~/Desktop/proxy.pac root@$IPHONE_IP:/private/var/root/</pre>
<p>On my Wi-Fi network, my iPhone&#8217;s IP is 192.168.1.52, so I typed this command:</p>
<pre style="border: 1px solid ; margin: 0px; padding: 6px; overflow: auto; width: auto; height: auto">scp ~/Desktop/proxy.pac root@192.168.1.52:/private/var/root/</pre>
<p>Hit &#8216;Enter&#8217; and it will prompt you for your iPhone&#8217;s root password. The default is &#8216;dottie&#8217;, without the quotes.</p>
<p>6) <em><strong>Update preferences.plist</strong></em> Now we&#8217;ll copy <code>preferences.plist</code> to our local system for editing. It&#8217;s located at <code>/private/var/root/Library/Preferences/SystemConfiguration/preferences.plist</code> on your iPhone. Download it to your desktop using your favorite file transfer client, or use this command:</p>
<pre style="border: 1px solid ; margin: 0px; padding: 6px; overflow: auto; width: auto; height: auto">scp root@$IPHONE_IP:/private/var/root/Library/Preferences/SystemConfiguration/preferences.plist ~/Desktop/</pre>
<p>Open up the preferences.plist file from your Desktop in your text editor, and look for the area of the file where it has the lines:</p>
<p>&lt;key&gt;DeviceName&lt;/key&gt;<br />
&lt;string&gt;ip1&lt;string&gt;</p>
<p>Note that the text inside the string tags should be ip1 (as opposed to en0, ip2 or anything else). Now add the following chunk of xml (in red) to the file in the appropriate place (<a href="http://www.hackint0sh.org/forum/showthread.php?t=6365">thanks to syasses</a>):</p>
<p>&lt;key&gt;Interface&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;DeviceName&lt;/key&gt;<br />
&lt;string&gt;ip1&lt;/string&gt;<br />
&lt;key&gt;Hardware&lt;/key&gt;<br />
&lt;string&gt;com.apple.CommCenter&lt;/string&gt;<br />
&lt;key&gt;Type&lt;/key&gt;<br />
&lt;string&gt;com.apple.CommCenter&lt;/string&gt;<br />
&lt;/dict&gt;</p>
<div style="color: red">&lt;key&gt;Proxies&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;ProxyAutoConfigEnable&lt;/key&gt;<br />
&lt;integer&gt;1&lt;/integer&gt;<br />
&lt;key&gt;ProxyAutoConfigURLString&lt;/key&gt;<br />
&lt;string&gt;file:///private/var/root/proxy.pac&lt;/string&gt;<br />
&lt;/dict&gt;</div>
<p>&lt;key&gt;com.apple.CommCenter&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;AllowNetworkAccess&lt;/key&gt;<br />
&lt;integer&gt;1&lt;/integer&gt;<br />
&lt;key&gt;Available&lt;/key&gt;<br />
&lt;integer&gt;1&lt;/integer&gt;<br />
&lt;key&gt;Setup&lt;/key&gt;<br />
By adding this code to the file, you&#8217;re instructing your iPhone to use a proxy (T-Mobile&#8217;s t-zones server) for your communications over GPRS. Save the file.<br />
Now upload the file back to your iPhone with the command:</p>
<pre style="border: 1px solid ; margin: 0px; padding: 6px; overflow: auto; width: auto; height: auto">scp ~/Desktop/preferences.plist root@$IPHONE_IP:/private/var/root/Library/Preferences/SystemConfiguration/</pre>
<p>7) <em><strong>Restart the iPhone</strong></em> Hold down the sleep button for 3 seconds on your iPhone, and then turn it off. Turn it back on, and you should be able to access the Internet through t-zones for just $6!</p>
<p>I tested my GPRS speed at iphonenetworktest.com and I got 154.2 kbps.</p>
]]></content:encoded>
			<wfw:commentRss>http://arashpayan.com/blog/2007/09/17/t-zones-aka-599-internet-access-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>119</slash:comments>
		</item>
	</channel>
</rss>

