<?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>Sorted Bits &#187; iPhone</title>
	<atom:link href="http://www.sortedbits.com/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sortedbits.com</link>
	<description>objectiveC, C# and more interesting stuff</description>
	<lastBuildDate>Wed, 04 Jan 2012 10:11:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Protected: Localize your UIViews (the easy way)</title>
		<link>http://www.sortedbits.com/localize-your-uiviews-the-easy-way/</link>
		<comments>http://www.sortedbits.com/localize-your-uiviews-the-easy-way/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 13:21:35 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[cocoa-touch]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.wim.me/?p=1357</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.sortedbits.com/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-1357">Password:<br />
<input name="post_password" id="pwbox-1357" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/localize-your-uiviews-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Placing curved text on an UIImage</title>
		<link>http://www.sortedbits.com/placing-curved-text-on-an-uiimage/</link>
		<comments>http://www.sortedbits.com/placing-curved-text-on-an-uiimage/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 10:26:51 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[circle]]></category>
		<category><![CDATA[cocoa-touch]]></category>
		<category><![CDATA[curve]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objectivec]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=1210</guid>
		<description><![CDATA[For a project I am doing for a client, I needed to layout text around a circle in objective-C. I spend a couple of hours searching the internet for this, but somehow when people succeed in doing this, they don&#8217;t post their solution online. So, I made [...]]]></description>
			<content:encoded><![CDATA[<p>For a project I am doing for a client, I needed to layout text around a circle in objective-C. I spend a couple of hours searching the internet for this, but somehow when people succeed in doing this, they don&#8217;t post their solution online.</p>
<p>So, I made an array of NSString objects that I wanted to lay out, around that circle.</p>
<div id="gist-1302242" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="n">NSArray</span><span class="o">*</span> <span class="n">sections</span> <span class="o">=</span> <span class="p">[[</span><span class="n">NSArray</span> <span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithObjects:</span><span class="s">@&quot;text1&quot;</span><span class="p">,</span> <span class="s">@&quot;text2&quot;</span><span class="p">,</span> <span class="s">@&quot;text3&quot;</span><span class="p">,</span> <span class="s">@&quot;text4&quot;</span><span class="p">,</span> <span class="nb">nil</span><span class="p">];</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="k">-</span> <span class="p">(</span><span class="n">UIImage</span><span class="o">*</span><span class="p">)</span> <span class="nf">createMenuRingWithFrame:</span><span class="p">(</span><span class="n">CGRect</span><span class="p">)</span><span class="nv">frame</span></div><div class='line' id='LC4'><span class="p">{</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// First fix the frame to make sure it uses the right scaling (iPhone 4 / iPad compatibility).</span></div><div class='line' id='LC6'>	<span class="n">frame</span> <span class="o">=</span> <span class="n">CGRectMake</span><span class="p">(</span><span class="n">frame</span><span class="p">.</span><span class="n">origin</span><span class="p">.</span><span class="n">x</span><span class="p">,</span> <span class="n">frame</span><span class="p">.</span><span class="n">origin</span><span class="p">.</span><span class="n">y</span><span class="p">,</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span> <span class="o">*</span> <span class="n">scale</span><span class="p">,</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">height</span> <span class="o">*</span> <span class="n">scale</span><span class="p">);</span></div><div class='line' id='LC7'><br/></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Same for the text radius</span></div><div class='line' id='LC9'>	<span class="kt">float</span> <span class="n">scaledTextRadius</span> <span class="o">=</span> <span class="n">textRadius</span> <span class="o">*</span> <span class="n">scale</span><span class="p">;</span></div><div class='line' id='LC10'>	<span class="kt">float</span> <span class="n">scaledRingWidth</span> <span class="o">=</span> <span class="n">ringWidth</span><span class="p">;</span></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Define the centerpoint of the circle.</span></div><div class='line' id='LC13'>	<span class="n">CGPoint</span> <span class="n">centerPoint</span> <span class="o">=</span> <span class="n">CGPointMake</span><span class="p">(</span><span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span> <span class="o">/</span> <span class="mi">2</span><span class="p">,</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">height</span> <span class="o">/</span> <span class="mi">2</span><span class="p">);</span></div><div class='line' id='LC14'><br/></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// self.menuItemsFont is of the type UIFont, which I use to get the font for displaying the text on the circle.</span></div><div class='line' id='LC16'>	<span class="kt">char</span><span class="o">*</span> <span class="n">fontName</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="o">*</span><span class="p">)[</span><span class="n">self</span><span class="p">.</span><span class="n">menuItemsFont</span><span class="p">.</span><span class="n">fontName</span> <span class="nl">cStringUsingEncoding:</span><span class="n">NSASCIIStringEncoding</span><span class="p">];</span></div><div class='line' id='LC17'><br/></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// 2 UIColor&#39;s, which I need for the color of the circle and for the text</span></div><div class='line' id='LC19'>	<span class="n">ringColor</span> <span class="o">=</span> <span class="p">[</span><span class="n">UIColor</span> <span class="nl">colorWithRed:</span><span class="mi">1</span> <span class="nl">green:</span><span class="mi">1</span> <span class="nl">blue:</span><span class="mi">1</span> <span class="nl">alpha:</span><span class="mf">0.7</span><span class="p">];</span></div><div class='line' id='LC20'>	<span class="n">textColor</span> <span class="o">=</span> <span class="p">[</span><span class="n">UIColor</span> <span class="nl">colorWithRed:</span><span class="mi">0</span> <span class="nl">green:</span><span class="mi">0</span> <span class="nl">blue:</span><span class="mi">0</span> <span class="nl">alpha:</span><span class="mi">1</span><span class="p">];</span></div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'>	<span class="n">CGFloat</span><span class="o">*</span> <span class="n">ringColorComponents</span> <span class="o">=</span> <span class="p">(</span><span class="kt">float</span><span class="o">*</span><span class="p">)</span><span class="n">CGColorGetComponents</span><span class="p">(</span><span class="n">ringColor</span><span class="p">.</span><span class="n">CGColor</span><span class="p">);</span></div><div class='line' id='LC23'>	<span class="n">CGFloat</span><span class="o">*</span> <span class="n">textColorComponents</span> <span class="o">=</span> <span class="p">(</span><span class="kt">float</span><span class="o">*</span><span class="p">)</span><span class="n">CGColorGetComponents</span><span class="p">(</span><span class="n">textColor</span><span class="p">.</span><span class="n">CGColor</span><span class="p">);</span></div><div class='line' id='LC24'><br/></div><div class='line' id='LC25'>	<span class="n">CGColorSpaceRef</span> <span class="n">colorSpace</span> <span class="o">=</span> <span class="n">CGColorSpaceCreateDeviceRGB</span><span class="p">();</span></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">CGContextRef</span> <span class="n">context</span> <span class="o">=</span> <span class="n">CGBitmapContextCreate</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span><span class="p">,</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">height</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">4</span> <span class="o">*</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span><span class="p">,</span> <span class="n">colorSpace</span><span class="p">,</span> <span class="n">kCGImageAlphaPremultipliedFirst</span><span class="p">);</span></div><div class='line' id='LC27'><br/></div><div class='line' id='LC28'>	<span class="n">CGContextSetTextMatrix</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">CGAffineTransformIdentity</span><span class="p">);</span></div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'>	<span class="n">CGContextSelectFont</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">fontName</span><span class="p">,</span> <span class="mi">18</span> <span class="o">*</span> <span class="n">scale</span><span class="p">,</span> <span class="n">kCGEncodingMacRoman</span><span class="p">);</span></div><div class='line' id='LC31'>	<span class="n">CGContextSetRGBStrokeColor</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">ringColorComponents</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">ringColorComponents</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">ringColorComponents</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">ringAlpha</span><span class="p">);</span></div><div class='line' id='LC32'>	<span class="n">CGContextSetLineWidth</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">scaledRingWidth</span><span class="p">);</span></div><div class='line' id='LC33'><br/></div><div class='line' id='LC34'>	<span class="n">CGContextStrokeEllipseInRect</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">CGRectMake</span><span class="p">(</span><span class="n">scaledRingWidth</span><span class="p">,</span> <span class="n">scaledRingWidth</span><span class="p">,</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">width</span> <span class="o">-</span> <span class="p">(</span><span class="n">scaledRingWidth</span> <span class="o">*</span> <span class="mi">2</span><span class="p">),</span> <span class="n">frame</span><span class="p">.</span><span class="n">size</span><span class="p">.</span><span class="n">height</span> <span class="o">-</span> <span class="p">(</span><span class="n">scaledRingWidth</span> <span class="o">*</span> <span class="mi">2</span><span class="p">)));</span></div><div class='line' id='LC35'>	<span class="n">CGContextSetRGBFillColor</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">textColorComponents</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">textColorComponents</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">textColorComponents</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">textAlpha</span><span class="p">);</span></div><div class='line' id='LC36'><br/></div><div class='line' id='LC37'>	<span class="n">CGContextSaveGState</span><span class="p">(</span><span class="n">context</span><span class="p">);</span></div><div class='line' id='LC38'>	<span class="n">CGContextTranslateCTM</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">centerPoint</span><span class="p">.</span><span class="n">x</span><span class="p">,</span> <span class="n">centerPoint</span><span class="p">.</span><span class="n">y</span><span class="p">);</span></div><div class='line' id='LC39'><br/></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// define the angles of the texts to divide them evenly on the circle.</span></div><div class='line' id='LC41'>	<span class="kt">float</span> <span class="n">angleStep</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">M_PI</span> <span class="o">/</span> <span class="p">[</span><span class="n">sections</span> <span class="n">count</span><span class="p">];</span></div><div class='line' id='LC42'><br/></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// I set the starting-angle on 90 degrees, to make sure the first text was ON TOP of the circle.</span></div><div class='line' id='LC44'>	<span class="kt">float</span> <span class="n">angle</span> <span class="o">=</span> <span class="n">degreesToRadians</span><span class="p">(</span><span class="mi">90</span><span class="p">);</span></div><div class='line' id='LC45'><br/></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Some custom text-radius fixing (and scaling for iPhone 4 &amp;amp; iPad). To make sure my text centered nicely.</span></div><div class='line' id='LC47'>	<span class="n">scaledTextRadius</span> <span class="o">=</span> <span class="n">scaledTextRadius</span> <span class="o">-</span> <span class="mi">12</span> <span class="o">*</span> <span class="n">scale</span><span class="p">;</span></div><div class='line' id='LC48'><br/></div><div class='line' id='LC49'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Loop through texts and draw them at the appropriate angle.</span></div><div class='line' id='LC50'>	<span class="k">for</span> <span class="p">(</span><span class="n">NSString</span><span class="o">*</span> <span class="n">text</span> <span class="k">in</span> <span class="n">sections</span><span class="p">)</span></div><div class='line' id='LC51'>	<span class="p">{</span></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// call a method that actually draws the text at an angle</span></div><div class='line' id='LC53'>		<span class="p">[</span><span class="n">self</span> <span class="nl">drawStringAtContext:</span><span class="n">context</span> <span class="nl">string:</span><span class="n">text</span> <span class="nl">atAngle:</span><span class="n">angle</span> <span class="nl">withRadius:</span><span class="n">scaledTextRadius</span><span class="p">];</span></div><div class='line' id='LC54'>		<span class="n">angle</span> <span class="o">-=</span> <span class="n">angleStep</span><span class="p">;</span></div><div class='line' id='LC55'>	<span class="p">}</span></div><div class='line' id='LC56'><br/></div><div class='line' id='LC57'>	<span class="n">CGContextRestoreGState</span><span class="p">(</span><span class="n">context</span><span class="p">);</span></div><div class='line' id='LC58'><br/></div><div class='line' id='LC59'>	<span class="n">CGImageRef</span> <span class="n">contextImage</span> <span class="o">=</span> <span class="n">CGBitmapContextCreateImage</span><span class="p">(</span><span class="n">context</span><span class="p">);</span></div><div class='line' id='LC60'><br/></div><div class='line' id='LC61'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// Release the stuff to avoid memory leaks.</span></div><div class='line' id='LC62'>	<span class="n">CGContextRelease</span><span class="p">(</span><span class="n">context</span><span class="p">);</span></div><div class='line' id='LC63'>	<span class="n">CGColorSpaceRelease</span><span class="p">(</span><span class="n">colorSpace</span><span class="p">);</span></div><div class='line' id='LC64'><br/></div><div class='line' id='LC65'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="p">[</span><span class="n">UIImage</span> <span class="nl">imageWithCGImage:</span><span class="n">contextImage</span><span class="p">];</span></div><div class='line' id='LC66'><br/></div><div class='line' id='LC67'><span class="p">}</span></div><div class='line' id='LC68'><br/></div><div class='line' id='LC69'><span class="c1">// This method draws the text at an angle, while the location is based on the radius + angle.</span></div><div class='line' id='LC70'><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="nf">drawStringAtContext:</span><span class="p">(</span><span class="n">CGContextRef</span><span class="p">)</span> <span class="n">context</span> <span class="nl">string:</span><span class="p">(</span><span class="n">NSString</span><span class="o">*</span><span class="p">)</span> <span class="n">text</span> <span class="nl">atAngle:</span><span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">angle</span> <span class="nl">withRadius:</span><span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">radius</span></div><div class='line' id='LC71'><span class="p">{</span></div><div class='line' id='LC72'>	<span class="c1">// Scale the fontsize to match UIScreen scaling</span></div><div class='line' id='LC73'>	<span class="n">UIFont</span><span class="o">*</span> <span class="n">scaledMenuItemsFont</span> <span class="o">=</span> <span class="p">[</span><span class="n">menuItemsFont</span> <span class="nl">fontWithSize:</span><span class="mi">18</span> <span class="o">*</span> <span class="n">scale</span><span class="p">];</span></div><div class='line' id='LC74'><br/></div><div class='line' id='LC75'>	<span class="c1">// Get the size of the string when it would be drawn with the selected font</span></div><div class='line' id='LC76'>	<span class="n">CGSize</span> <span class="n">textSize</span> <span class="o">=</span> <span class="p">[</span><span class="n">text</span> <span class="nl">sizeWithFont:</span><span class="n">scaledMenuItemsFont</span><span class="p">];</span></div><div class='line' id='LC77'><br/></div><div class='line' id='LC78'>	<span class="kt">float</span> <span class="n">perimeter</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">M_PI</span> <span class="o">*</span> <span class="n">radius</span><span class="p">;</span></div><div class='line' id='LC79'><br/></div><div class='line' id='LC80'>	<span class="c1">// determine the angle of the text.</span></div><div class='line' id='LC81'>	<span class="kt">float</span> <span class="n">textAngle</span> <span class="o">=</span> <span class="p">(</span><span class="n">textSize</span><span class="p">.</span><span class="n">width</span><span class="p">)</span> <span class="o">/</span> <span class="n">perimeter</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">M_PI</span><span class="p">;</span></div><div class='line' id='LC82'>	<span class="n">angle</span> <span class="o">+=</span> <span class="n">textAngle</span> <span class="o">/</span> <span class="mi">2</span><span class="p">;</span></div><div class='line' id='LC83'><br/></div><div class='line' id='LC84'>	<span class="c1">// We loop through each letter in the string, so we can set the angle for each letter right</span></div><div class='line' id='LC85'>	<span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">index</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">index</span> <span class="o">&amp;</span><span class="n">lt</span><span class="p">;</span> <span class="p">[</span><span class="n">text</span> <span class="n">length</span><span class="p">];</span> <span class="n">index</span><span class="o">++</span><span class="p">)</span></div><div class='line' id='LC86'>	<span class="p">{</span></div><div class='line' id='LC87'>	    <span class="c1">// Get the correct letter by the index</span></div><div class='line' id='LC88'>		<span class="n">NSRange</span> <span class="n">range</span> <span class="o">=</span> <span class="p">{</span><span class="n">index</span><span class="p">,</span> <span class="mi">1</span><span class="p">};</span></div><div class='line' id='LC89'>		<span class="n">NSString</span><span class="o">*</span> <span class="n">letter</span> <span class="o">=</span> <span class="p">[</span><span class="n">text</span> <span class="nl">substringWithRange:</span><span class="n">range</span><span class="p">];</span></div><div class='line' id='LC90'>		<span class="kt">char</span><span class="o">*</span> <span class="n">c</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="o">*</span><span class="p">)[</span><span class="n">letter</span> <span class="nl">cStringUsingEncoding:</span><span class="n">NSASCIIStringEncoding</span><span class="p">];</span></div><div class='line' id='LC91'>		<span class="n">CGSize</span> <span class="n">charSize</span> <span class="o">=</span> <span class="p">[</span><span class="n">letter</span> <span class="nl">sizeWithFont:</span><span class="n">scaledMenuItemsFont</span><span class="p">];</span></div><div class='line' id='LC92'><br/></div><div class='line' id='LC93'>	    <span class="c1">// Determin the X and Y position of the letter based on the angle and the radius</span></div><div class='line' id='LC94'>		<span class="kt">float</span> <span class="n">x</span> <span class="o">=</span> <span class="n">radius</span> <span class="o">*</span> <span class="n">cos</span><span class="p">(</span><span class="n">angle</span><span class="p">);</span></div><div class='line' id='LC95'>		<span class="kt">float</span> <span class="n">y</span> <span class="o">=</span> <span class="n">radius</span> <span class="o">*</span> <span class="n">sin</span><span class="p">(</span><span class="n">angle</span><span class="p">);</span></div><div class='line' id='LC96'><br/></div><div class='line' id='LC97'>		<span class="kt">float</span> <span class="n">letterAngle</span> <span class="o">=</span> <span class="p">(</span><span class="n">charSize</span><span class="p">.</span><span class="n">width</span> <span class="o">/</span> <span class="n">perimeter</span> <span class="o">*</span> <span class="o">-</span><span class="mi">2</span> <span class="o">*</span> <span class="n">M_PI</span><span class="p">);</span></div><div class='line' id='LC98'><br/></div><div class='line' id='LC99'>	    <span class="c1">// Save the state of the context, because rotations are based on the original origin</span></div><div class='line' id='LC100'>		<span class="n">CGContextSaveGState</span><span class="p">(</span><span class="n">context</span><span class="p">);</span></div><div class='line' id='LC101'>		<span class="n">CGContextTranslateCTM</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">);</span></div><div class='line' id='LC102'>	    <span class="c1">// Rotate the canvas so we can just draw our text horizontally</span></div><div class='line' id='LC103'>		<span class="n">CGContextRotateCTM</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="p">(</span><span class="n">angle</span> <span class="o">-</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="n">M_PI</span><span class="p">));</span></div><div class='line' id='LC104'>		<span class="n">CGContextShowTextAtPoint</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">strlen</span><span class="p">(</span><span class="n">c</span><span class="p">));</span></div><div class='line' id='LC105'>	    <span class="c1">// Restore the context again.</span></div><div class='line' id='LC106'>		<span class="n">CGContextRestoreGState</span><span class="p">(</span><span class="n">context</span><span class="p">);</span></div><div class='line' id='LC107'><br/></div><div class='line' id='LC108'>		<span class="n">angle</span> <span class="o">+=</span> <span class="n">letterAngle</span><span class="p">;</span></div><div class='line' id='LC109'>	<span class="p">}</span></div><div class='line' id='LC110'><span class="p">}</span></div><div class='line' id='LC111'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1302242/0d62efc44eb7d0b2219731bc7a424fd41d4e3103/gistfile1.m" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1302242#file_gistfile1.m" style="float:right;margin-right:10px;color:#666">gistfile1.m</a>
            <a href="https://gist.github.com/1302242">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>I came to this solution after I asked a question on StackOverflow, which was helpfully demonstrated by Dribbel on how to do it. Credits for that to him.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/placing-curved-text-on-an-uiimage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sending an email with an attachment from your iPhone</title>
		<link>http://www.sortedbits.com/sending-an-email-with-an-attachment-from-your-iphone/</link>
		<comments>http://www.sortedbits.com/sending-an-email-with-an-attachment-from-your-iphone/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 10:29:48 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[desktop backgrounds hd]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=840</guid>
		<description><![CDATA[For Desktop Backgrounds HD (which is currently in review) I wanted to implement a feature called &#8220;send image by email&#8221;. First I tried to include an image base64 encoded in an URL, with the mailto: protocol, but this resulted in numerous errors. So after a coupe of [...]]]></description>
			<content:encoded><![CDATA[<p>For Desktop Backgrounds HD (which is currently in review) I wanted to implement a feature called &#8220;send image by email&#8221;. First I tried to include an image base64 encoded in an URL, with the mailto: protocol, but this resulted in numerous errors.</p>
<p>So after a coupe of google searches, I came up with the following solution, follow these steps and you will be sending emails with attachments before you can say &#8220;emails with attachments&#8221; 250 times.<br />
<span id="more-851"></span><br />
<strong>Step 1</strong><br />
First add the MessageUI framework in your application.</p>
<p><strong>Step 2</strong><br />
The class you want to use the functionality in, should get the following 2 imports:</p>
<pre>#import
#import </pre>
<p><strong>Step 3</strong><br />
Make sure your class listens to the MFMailComposeViewControllerDelegate.</p>
<p><strong>Step 4</strong><br />
Next up, is to add code to add an attachment to the mail composer and open it up.</p>
<pre>MFMailComposeViewController* composer = [[MFMailComposeViewController alloc] init];
composer.mailComposeDelegate = self;

[composer setSubject:@"The subject of the email"];
NSData *imageData = UIImagePNGRepresentation([UIImage imageNamed:@"test.png"], 1);
[composer addAttachmentData:imageData mimeType:@"image/png" fileName:@"test.png"];
NSString *emailBody = @"Check out this amazing PNG!";
[composer setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:composer animated:YES];
[composer release];</pre>
<p><strong>Step 5</strong><br />
Add this method, to make sure you get back full control over your view-controller:</p>
<pre>- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
	[self dismissModalViewControllerAnimated:YES];
}</pre>
<p>In this last method you can also perform error checking, which is not included in this example. Hope this helps anyone, and if not&#8230; too bad <img src='http://www.sortedbits.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/sending-an-email-with-an-attachment-from-your-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Note to self: how to convert hex codes in a NSString</title>
		<link>http://www.sortedbits.com/note-to-self-how-to-convert-hex-codes-in-a-nsstring/</link>
		<comments>http://www.sortedbits.com/note-to-self-how-to-convert-hex-codes-in-a-nsstring/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 07:23:53 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=828</guid>
		<description><![CDATA[I have been working with Freebase lately and they sometimes encode their strings, so that &#8220;special&#8221; characters are encoded in HEX. For example, sometimes you receive a string like this: Terminator_2$003A_Judgment_Day. I wanted to convert the weird encoding they use, so I wrote a piece of code [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with Freebase lately and they sometimes encode their strings, so that &#8220;special&#8221; characters are encoded in HEX.</p>
<p>For example, sometimes you receive a string like this: <strong>Terminator_2$003A_Judgment_Day</strong>. I wanted to convert the weird encoding they use, so I wrote a piece of code for that. It might be that this could be encoded some other way and then I would like to hear from you, but here is my code:<br />
<span id="more-828"></span></p>
<pre>
+ (NSString*) replaceHexInString:(NSString*) value
{
	NSRange range = [value rangeOfString:@"$00"];

	while (range.location != NSNotFound)
	{
		if (range.location + 5 &lt;= [value length])
		{
			NSString* hexValue = [value substringFromIndex:range.location];
			hexValue = [hexValue substringToIndex:5];
			NSString* newHexValue = [hexValue stringByReplacingOccurrencesOfString:@&quot;$&quot; withString:@&quot;0x&quot;];

			unsigned int dec;
			NSScanner *scan = [NSScanner scannerWithString:newHexValue];

			if ([scan scanHexInt:&amp;dec])
			{
				NSString* convertedValue = [NSString stringWithFormat:@&quot;%c&quot;, dec];
				value = [value stringByReplacingOccurrencesOfString:hexValue withString:convertedValue];
			}
		}

		range = [value rangeOfString:@&quot;$00&quot;];
	}
	return value;
}
</pre>
<p>I know this probably does not get the UTF-16 characters, but in my case I (hope to) know they won&#8217;t use them.</p>
<p>Well, that&#8217;s about it. Not sure if anyone can use this, but I do <img src='http://www.sortedbits.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/note-to-self-how-to-convert-hex-codes-in-a-nsstring/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Queueing HTTP requests in objC</title>
		<link>http://www.sortedbits.com/queueing-http-requests-in-objc/</link>
		<comments>http://www.sortedbits.com/queueing-http-requests-in-objc/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 18:55:51 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.wimhaanstra.com/?p=742</guid>
		<description><![CDATA[For WallPaper I download numerous thumbnails from my webserver at the same time. This is causing slowing speeds (to many threads at once), and too much memory usage (too much image data cached at once). So I looked in queueing the downloads and tried (ofcourse) writing my [...]]]></description>
			<content:encoded><![CDATA[<p>For WallPaper I download numerous thumbnails from my webserver at the same time. This is causing slowing speeds (to many threads at once), and too much memory usage (too much image data cached at once).</p>
<p>So I looked in queueing the downloads and tried (ofcourse) writing my own QueueHandler class. After I written and spend a couple of hours bughunting/testing my QueueuHandler, I came to the <strong>awesome</strong> idea to see what the iPhone SDK supplies for this kind of jobs <img src='http://www.sortedbits.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  (you DO read my sarcasm, dont you?).<br />
<span id="more-742"></span><br />
I am using <a title="ASIHTTPRequest Website" href="http://allseeing-i.com/ASIHTTPRequest/" target="_blank">ASIHTTPRequest</a> for my web-requests in WallPaper. I will just show you how I queue my downloads and when the download finishes, I put the image in a predefined and created UIImageView.</p>
<p>I first declare a couple of variables in my <strong>.h</strong> file.</p>
<pre>NSMutableArray* downloadQueue;
NSOperationQueue* queue;</pre>
<p>I added some UIImageView&#8217;s to a view and I put them and the download URL in a NSMutableDictionary, like this:</p>
<pre>NSMutableDictionary* threadArguments = [[NSMutableDictionary alloc] init];

[threadArguments setObject:myUrl forKey:@&quot;url&quot;];
[threadArguments setObject:myImageView forKey:@&quot;iv&quot;];

[self addToDownloadQueue:threadArguments];</pre>
<p>The <strong>addToDownloadQueue</strong> method does something like this after that (<strong>threadArguments</strong> is the parameter the method is receiving).</p>
<pre>// Add the object to the NSMutableArray I got stored.
[downloadQueue addObject:threadArguments];
if (!queue)
{
	queue = [[NSOperationQueue alloc] init];
	[queue setMaxConcurrentOperationCount:1];
}

NSString* threadUrl = [threadArguments valueForKey:@&quot;url&quot;];
NSURL* downloadUrl = [NSURL URLWithString:threadUrl];
ASIHTTPRequest* request = [ASIHTTPRequest requestWithURL:downloadUrl];
[request setDelegate:self];
[request setDidFinishSelector:@selector(downloadDone:)];
[request setDidFailSelector:@selector(downloadFailed:)];</pre>
<p>I put the <strong>MaxConcurrentOperationCount</strong> on <strong>1</strong> to make sure the application sends the requests for thumbnails one by one (going easy on your bandwidth and on my server).</p>
<p>Now we need to implement the FinishSelector and the FailSelector methods to catch the downloads that are finished and put the downloaded image in the pre-created UIImageView.</p>
<pre>- (void)downloadFailed:(ASIHTTPRequest *)request
{
	NSLog(@&quot;Downloading failed?&quot;);
}

- (void)downloadDone:(ASIHTTPRequest *)request
{
	NSString* downloadUrl = [request.url absoluteString];

	NSMutableDictionary* foundObj = nil;

	for (NSMutableDictionary* dict in downloadQueue)
	{
		NSString* queueUrl = [dict valueForKey:@&quot;url&quot;];

		if ([downloadUrl isEqualToString:queueUrl])
		{
			UIImageView* iv = (UIImageView*)[dict valueForKey:@&quot;iv&quot;];
			NSData* imageData = request.rawResponseData;

			if (iv != nil)
				iv.image = [UIImage imageWithData:imageData];

			foundObj = dict;
		}
	}

	if (foundObj != nil)
		[downloadQueue removeObject:foundObj];
}</pre>
<p>*Ok, somehow my code syntax highlighting screws up the indenting.*</p>
<p>Well, I hope you can use something of my weird code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/queueing-http-requests-in-objc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jailbreaking an unlocked iPhone 3G</title>
		<link>http://www.sortedbits.com/jailbreaking-an-unlocked-iphone-3g/</link>
		<comments>http://www.sortedbits.com/jailbreaking-an-unlocked-iphone-3g/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 18:59:37 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Firmware 2.0]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Jailbreak]]></category>
		<category><![CDATA[unlocked]]></category>
		<category><![CDATA[WinPwn]]></category>

		<guid isPermaLink="false">http://www.depl0y.com/?p=170</guid>
		<description><![CDATA[So, I just got back from my holiday camping out near the sea, when I needed a new challenge . I decided (after reading a lot of stories on the net) that it was time to jailbreak my new iPhone. All the stories I read online, about [...]]]></description>
			<content:encoded><![CDATA[<p>So, I just got back from my holiday camping out near the sea, when I needed a new challenge <img src='http://www.sortedbits.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> . I decided (after reading a lot of stories on the net) that it was time to jailbreak my new iPhone.</p>
<p>All the stories I read online, about people who jailbroke their phones, used sim-locked phones so I was quite scared that maybe jailbreaking my officially unlocked phone, would somehow fuxxor it up.</p>
<p>I downloaded WinPwn for my Windows machine and downloaded the latest 2.0 firmware for the 3G phone, from the Apple site. After that I made my own IPSW and iPwned my iTunes (I chose not to &#8216;Activate&#8217; my iPhone while pwning it).</p>
<p>The first attempt, flashing the firmware ended up in a scary -1 error. My phone was hanging in the process of booting. I put my phone back in DFU mode (<a href="http://www.iclarified.com/entry/index.php?enid=1034">which actually is very easy to do</a>) and tried restoring again with my custom firmware.</p>
<p>Voila&#8230; after a 10 minute wait, there it was! My unlocked iPhone 3G was jailbroken and Cydia was installed for me to supply me with some new toys to play with!</p>
<p>So, if you ever wonder: will jailbreaking my unlocked iPhone fuck my phone&#8230; no.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/jailbreaking-an-unlocked-iphone-3g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is taking this long?</title>
		<link>http://www.sortedbits.com/what-is-taking-this-long/</link>
		<comments>http://www.sortedbits.com/what-is-taking-this-long/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 13:20:13 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone 3G]]></category>
		<category><![CDATA[unlocked]]></category>

		<guid isPermaLink="false">http://www.depl0y.com/?p=144</guid>
		<description><![CDATA[So, the iPhone 3G was released last Friday and stores almost can&#8217;t handle the demand for the thing. It seems that Apple sold over a million (yes: 1.000.000) iPhones in the first weekend. Too bad they only sold 7.000 in the Netherlands and only 4.000 in Belgium. [...]]]></description>
			<content:encoded><![CDATA[<p>So, the iPhone 3G was released last Friday and stores almost can&#8217;t handle the demand for the thing. It seems that Apple sold over a million (yes: 1.000.000) iPhones in the first weekend. Too bad they only sold 7.000 in the Netherlands and only 4.000 in Belgium.</p>
<p>Since last friday there have been stories that de iPhone dev-team will be releasing their PwnageTool soon, so that we, iPhone 2G users, can finally upgrade to firmware 2.0 without risking our phones to get locked again. I am eagerly awaiting the release of that tool, because I can&#8217;t wait to try out the AppStore and finally some Exchange support.</p>
<p>There also have been some interesting stories on the dev-team&#8217;s blog, where they describe different parts of the hack and are already showing off their nice little tool. As it seems, they added a jailbreak for the iPhone 3G also, although it&#8217;s a shame that they postponed the release of their tool for that.</p>
<p>The blog of the iPhone dev-team.George Hotz&#8217; blog</p>
<p>On the links mentioned above, you can follow a long discussion about the dev-team, George Hotz and more iPhone &#8216;scene&#8217; people. There has been some serious shit throwing in that scene the last week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/what-is-taking-this-long/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is it me, or is it getting hot in here?</title>
		<link>http://www.sortedbits.com/is-it-me-or-is-it-getting-hot-in-here/</link>
		<comments>http://www.sortedbits.com/is-it-me-or-is-it-getting-hot-in-here/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 20:32:34 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Firmware 2.0]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[unlocked]]></category>

		<guid isPermaLink="false">http://www.depl0y.com/?p=141</guid>
		<description><![CDATA[Ok, more and more stories about people getting the iPhone 3G are posted on the internet. The AppStore is online, the firmware 2.0 can be downloaded manually&#8230; these are busy times on the net. I have been looking around the AppStore for a while, just to see [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, more and more stories about people getting the iPhone 3G are posted on the internet. The AppStore is online, the firmware 2.0 can be downloaded manually&#8230; these are busy times on the net.</p>
<p>I have been looking around the AppStore for a while, just to see what is being offered and it all looks very promising. There probably is not even a reason to jailbreak anymore.</p>
<p>I haven&#8217;t installed the 2.0 firmware on my <a href="http://www.depl0y.com/personal/iphone-broken">broken iphone</a> yet, because mine is was sim-unlocked when I bought it. I think after I install the firmware update, my phone will be unusable until they actually hack the firmware.</p>
<p>The iPhone 2.0 firmware, install at your own risk!The people from iFixit are already opening up the new iPhone 3G.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/is-it-me-or-is-it-getting-hot-in-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone: Broken</title>
		<link>http://www.sortedbits.com/iphone-broken/</link>
		<comments>http://www.sortedbits.com/iphone-broken/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 07:08:03 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.depl0y.com/?p=128</guid>
		<description><![CDATA[My iPhone broke down . They always told me that the glass of the phone would be almost unbreakable, but I can prove it otherwise. After a small accident, the glass completly broke. The touch screen still works&#8230;a bit. It&#8217;s a sad loss, but there is no [...]]]></description>
			<content:encoded><![CDATA[<p>My iPhone broke down <img src='http://www.sortedbits.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . They always told me that the glass of the phone would be almost unbreakable, but I can prove it otherwise.</p>
<p>After a small accident, the glass completly broke. The touch screen still works&#8230;a bit.</p>
<table>
<tr>
<td>
<a href='http://www.wim.me/wp-content/uploads/2008/07/dsc000281.jpg' rel="thumbnail" rel="wp-prettyPhoto[128]"><img src="http://www.depl0y.com/wp-content/uploads/2008/07/dsc00028-150x150.jpg" alt="iPhone Broken #1" width="150" height="150" class="alignnone size-thumbnail wp-image-129" /></a>
</td>
<td>
<a href='http://www.wim.me/wp-content/uploads/2008/07/dsc000301.jpg' rel="thumbnail" rel="wp-prettyPhoto[128]"><img src="http://www.depl0y.com/wp-content/uploads/2008/07/dsc00030-150x150.jpg" alt="iPhone Broken #1" width="150" height="150" class="alignnone size-thumbnail wp-image-130" /></a>
</td>
<td>
<a href='http://www.wim.me/wp-content/uploads/2008/07/dsc000411.jpg' rel="thumbnail" rel="wp-prettyPhoto[128]"><img src="http://www.depl0y.com/wp-content/uploads/2008/07/dsc00041-150x150.jpg" alt="iPhone Broken #3" width="150" height="150" class="alignnone size-thumbnail wp-image-131" /></a></td>
</tr>
</table>
<p>It&#8217;s a sad loss, but there is no better reason to buy the 3G one, when it comes out <img src='http://www.sortedbits.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/iphone-broken/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Caterpillar/Kate for the iPhone</title>
		<link>http://www.sortedbits.com/caterpillarkate-for-the-iphone/</link>
		<comments>http://www.sortedbits.com/caterpillarkate-for-the-iphone/#comments</comments>
		<pubDate>Tue, 06 May 2008 06:16:50 +0000</pubDate>
		<dc:creator>Wim</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.depl0y.com/personal/caterpillarkate-for-the-iphone</guid>
		<description><![CDATA[I love my iPhone. There I said it. I know that many will think that this is still a hype and also that it is a piece of shit, but I love it. I think the Installer.app (when you use a jailbroken version) is da bomb and [...]]]></description>
			<content:encoded><![CDATA[<p>I love my iPhone. There I said it. I know that many will think that this is still a hype and also that it is a piece of shit, but I love it. I think the Installer.app (when you use a jailbroken version) is da bomb and it does make installing software on the iPhone as .. taking candy from a baby (a baby shouldn&#8217;t have candy to begin with&#8230;, at least not when I am around).</p>
<p>Installer.app also gives you the option to install tools as Summerboard and Customize, which pimp the appearance of your iPhone. But since I moved from firmware version 1.1.1 to 1.1.3 I missed an option which I loved. It&#8217;s called the 5-icon-dock. Apple changed some structure in the Springboard application which made it impossible for the normal hacks to work (don&#8217;t ask me what&#8230;.no really..don&#8217;t).</p>
<p>A couple of days ago I came across an application called Caterpillar (now known as Kate), which promised me the 5-icon-dock and more neat stuff. So I added the source of that application to my Installer.app and downloaded/installed it.</p>
<p>First I have to say is, it&#8217;s a pretty expensive application&#8230; for an iPhone application, but it really has some nice features which I haven&#8217;t seen yet in other free tools.</p>
<p><strong>Calendar or Appointments in your lock screen</strong><br />
When your iPhone is locked, it shows more than just the &#8216;slide to unlock&#8217; text now. It shows the appointments you have today or it shows you a normal calendar with dots on days where you have appointments.<br />
<img src='http://www.wim.me/wp-content/uploads/2008/05/lock_appointements1.png' alt='iPhone Lock screen with appointments' /> <img src='http://www.wim.me/wp-content/uploads/2008/05/lock_calendar1.png' alt='iPhone Lock screen with Calendar' /></p>
<p><strong>5-icon-dock</strong><br />
The screenshot says it all&#8230;.<br />
<img src='http://www.wim.me/wp-content/uploads/2008/05/iphone-5-icon-dock1.png' alt='iPhone 5-Icon-Dock' /></p>
<p><strong>Background around text</strong><br />
I love this option, because normally I had to choose to &#8216;dim&#8217; my wallpaper so that the icon-labels were kept readable, but this makes everything so much nicer <img src='http://www.sortedbits.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .<br />
<img src='http://www.wim.me/wp-content/uploads/2008/05/img_00021.png' alt='iPhone Background around text' /></p>
<p><strong>Font substitution</strong><br />
It replaces your system font, which (I think is the best there could be used, but still people might like it).<br />
<img src='http://www.wim.me/wp-content/uploads/2008/05/font_substitution2.png' alt='iPhone Font Substitution' /></p>
<p><strong>Uninstall from Springboard</strong><br />
Now, when you enter the &#8216;move your icons&#8217; mode on Springboard, crosses appear on applications too (normally only shown on bookmarks). Clicking such a cross will uninstall the application, not just remove it&#8217;s icon from the dock.<br />
<img src='http://www.wim.me/wp-content/uploads/2008/05/uninstall1.png' alt='iPhone Uninstall application from Springboard' /></p>
<p>Well these were only a couple of it&#8217;s features. You can check out the full changelog of the application <a href="http://www.ripdev.com/kate/version-history">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sortedbits.com/caterpillarkate-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

