<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>rel.me</title>
	<atom:link href="http://rel.me/feed/" rel="self" type="application/rss+xml" />
	<link>http://rel.me</link>
	<description></description>
	<lastBuildDate>Mon, 17 Dec 2012 14:05:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rel.me' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>rel.me</title>
		<link>http://rel.me</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rel.me/osd.xml" title="rel.me" />
	<atom:link rel='hub' href='http://rel.me/?pushpress=hub'/>
		<item>
		<title>Turing Fluid Demo (OS X) with Kinect Integration</title>
		<link>http://rel.me/2012/05/05/turing-fluid-demo-os-x-with-kinect-integration/</link>
		<comments>http://rel.me/2012/05/05/turing-fluid-demo-os-x-with-kinect-integration/#comments</comments>
		<pubDate>Sat, 05 May 2012 23:14:37 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://rel.me/?p=337</guid>
		<description><![CDATA[I ported @Flexi23&#8216;s WebGL Turing Fluid demo to OS X and added Kinect integration. You can find the source on github (turing-fluid-osx) This is a video using the mouse as input:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=337&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I ported @<a href="http://twitter.com/Flexi23">Flexi23</a>&#8216;s WebGL Turing Fluid demo to OS X and added Kinect integration. You can find the <a href="http://github.com/gabriel/turing-fluid-osx">source on github (turing-fluid-osx)</a></p>
<p>This is a video using the mouse as input:<br />
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='480' height='360' src='http://www.youtube.com/embed/jVktMGVhPoE?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=337&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2012/05/05/turing-fluid-demo-os-x-with-kinect-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>
	</item>
		<item>
		<title>3Hub now on the App Store</title>
		<link>http://rel.me/2011/04/26/3hub-now-on-the-app-store/</link>
		<comments>http://rel.me/2011/04/26/3hub-now-on-the-app-store/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 04:05:06 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://rel.me/?p=298</guid>
		<description><![CDATA[3Hub (formerly S3Hub) is now on the App Store. 3Hub is an Amazon S3 client for Mac OS X. For more details on 3Hub and its features, visit 3hubapp.com. Shares In addition to being an Amazon S3 client, 3Hub offers a cool decentralized sharing feature. Shares are a way to let your friends more easily keep [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=298&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>3Hub (formerly S3Hub) is now on <a href="http://itunes.apple.com/us/app/3hub/id427515976?mt=12">the App Store</a>. 3Hub is an Amazon S3 client for Mac OS X. For more details on 3Hub and its features, visit <a href="http://3hubapp.com">3hubapp.com</a>.</p>
<p><strong>Shares</strong></p>
<p>In addition to being an Amazon S3 client, 3Hub offers a cool decentralized sharing feature. Shares are a way to let your friends more easily keep track of what S3 buckets you have shared (for them).</p>
<div id="attachment_307" class="wp-caption alignnone" style="width: 513px"><a href="http://rel.me.s3.amazonaws.com/blog/3Hub-Shares22.png"><br />
<img class="size-full wp-image-307 " title="3Hub-Shares2" src="http://rel.me.s3.amazonaws.com/blog/3Hub-Shares22.png" alt="" width="503" height="405" /></a><p class="wp-caption-text">Sharing on 3Hub</p></div>
<p>Shares can be read only or both read and write. Permissions on files you upload to these shares are handled automatically.</p>
<p>When you make a bucket a &#8216;Share&#8217;, that bucket will show up when they browse you in their Friends list. To view what buckets your friend has given you permissions, you&#8217;ll need to add them in the Friends tab (using their email address). Selecting a friend in the friends tab will show you a list of buckets they have shared for you.</p>
<div id="attachment_301" class="wp-caption alignnone" style="width: 566px"><a href="//rel.me.s3.amazonaws.com/blog/3Hub-Friends.png"><img class="size-full wp-image-301 " title="3Hub-Friends" src="http://rel.me.s3.amazonaws.com/blog/3Hub-Friends.png" alt="" width="556" height="459" /></a><p class="wp-caption-text">Friends on 3Hub</p></div>
<p>Sharing works without contacting any 3rd-party server or &#8220;middleman&#8221; and works by storing meta-data information in certain expected file locations on S3 that are readable only by those you share with. It is essentially a private and distributed way to share files without having to use a Dropbox or other service that operates on top of S3.</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #f9f9f9} -->And shares are just buckets with permissions, nothing special. You can remove a bucket as a share at any time without having to update any files within those buckets. You can make an existing bucket a share by selecting the &#8216;Add as a Share&#8217; option.</p>
<p>And more features are coming soon to make sharing files with your friends on S3 even easier. Try it from <a href="http://itunes.apple.com/us/app/3hub/id427515976?mt=12">the App Store</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=298&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2011/04/26/3hub-now-on-the-app-store/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/3Hub-Shares22.png" medium="image">
			<media:title type="html">3Hub-Shares2</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/3Hub-Friends.png" medium="image">
			<media:title type="html">3Hub-Friends</media:title>
		</media:content>
	</item>
		<item>
		<title>JSON Parsing Speed Test: YAJL vs SBJSON (iPhone Edition)</title>
		<link>http://rel.me/2009/10/08/json-parsing-speed-test-yajl-vs-sbjson-iphone/</link>
		<comments>http://rel.me/2009/10/08/json-parsing-speed-test-yajl-vs-sbjson-iphone/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 06:18:57 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[sbjson]]></category>
		<category><![CDATA[yajl]]></category>

		<guid isPermaLink="false">http://rel.me/?p=255</guid>
		<description><![CDATA[I was curious about the difference, if any, in performance between SBJSON and YAJL with Objective-C bindings. SBJSON is a strict JSON parser written in Objective-C. YAJL is a small event-driven (SAX-style) JSON parser written in ANSI C. Awhile back I wrote YAJL Objective-C bindings and I did some very basic speed tests on JSON [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=255&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I was curious about the difference, if any, in performance between SBJSON and YAJL with Objective-C bindings. <a href="http://code.google.com/p/json-framework/">SBJSON</a> is a strict JSON parser written in Objective-C. <a href="http://lloyd.github.com/yajl/">YAJL</a> is a small event-driven (SAX-style) JSON parser written in ANSI C. Awhile back I wrote <a href="http://github.com/gabriel/yajl-objc">YAJL Objective-C bindings</a> and I did some very basic speed tests on JSON data from twitter, delicious, last.fm and yelp. I ran these tests on the original, 3G and 3GS iPhones.</p>
<p>The SBJSON test ran <code>NSString#JSONValue</code>, and the equivalent YAJL test ran <code>NSData#yajl_JSON</code>. The YAJL bindings operate directly on NSData, and this makes a bit more sense since we usually have NSData first, whereas for SBJSON you have to decode to a string before parsing. I <strong>didn&#8217;t</strong> include this difference in my tests though.</p>
<p>These are tests of parsing only (and not loading of any data or strings) of the 4 APIs datasets run 100 times on the original iPhone, 3G and 3GS:</p>
<hr />
<img src="http://rel.me.s3.amazonaws.com/blog/iphone.png" alt="iphone" title="iphone" width="575" height="320" class="aligncenter size-full wp-image-286" /></p>
<hr />
<img src="http://rel.me.s3.amazonaws.com/blog/iphone3g.png" alt="iphone3g" title="iphone3g" width="595" height="320" class="aligncenter size-full wp-image-285" /></p>
<hr />
<img src="http://rel.me.s3.amazonaws.com/blog/iphone3gs.png" alt="iphone3gs" title="iphone3gs" width="503" height="320" class="aligncenter size-full wp-image-284" /></p>
<hr />
<p>So the YAJL framework gives about a 60% speed increase. The YAJL Objective-C bindings can be found on <a href="http://github.com/gabriel/yajl-objc">github</a>.</p>
<p>Be sure to thank <a href="http://twitter.com/lloydhilaiel">@lloydhilaiel</a> for making <a href="http://lloyd.github.com/yajl/">YAJL</a> full of so much awesomeness.</p>
<p><b>Update</b>: The project used to do the perf test can be found <a href="http://github.com/gabriel/json-objc-perf">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/255/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=255&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2009/10/08/json-parsing-speed-test-yajl-vs-sbjson-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/iphone.png" medium="image">
			<media:title type="html">iphone</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/iphone3g.png" medium="image">
			<media:title type="html">iphone3g</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/iphone3gs.png" medium="image">
			<media:title type="html">iphone3gs</media:title>
		</media:content>
	</item>
		<item>
		<title>YAJL JSON Parser (Objective-C Bindings)</title>
		<link>http://rel.me/2009/06/15/yajl-json-parser-objective-c-bindings/</link>
		<comments>http://rel.me/2009/06/15/yajl-json-parser-objective-c-bindings/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 07:27:18 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[yajl]]></category>

		<guid isPermaLink="false">http://rel.me/?p=238</guid>
		<description><![CDATA[I recently was investigating using a more lightweight JSON parser for iPhone projects (other than the standard SBJSON library) and came across the YAJL C JSON library. While using it as a document style parser didn&#8217;t result in a huge performance gain, it does a support a streaming &#8220;SAX&#8221; style parser which might help memory [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=238&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I recently was investigating using a more lightweight JSON parser for iPhone projects (other than the standard <a href="http://code.google.com/p/json-framework/">SBJSON</a> library) and came across the <a href="http://lloyd.github.com/yajl/">YAJL</a> C JSON library. While using it as a document style parser didn&#8217;t result in a huge performance gain, it does a support a streaming &#8220;SAX&#8221; style parser which might help memory usage in larger documents.</p>
<p>Hopefully, sometime soon I will do some performance comparisons. In the meantime, if you try these bindings, let me know how it goes. You can find it on github at: <a href="http://github.com/gabriel/yajl-objc">http://github.com/gabriel/yajl-objc</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=238&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2009/06/15/yajl-json-parser-objective-c-bindings/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>
	</item>
		<item>
		<title>Invoking forward</title>
		<link>http://rel.me/2009/05/22/nsinvocation-nsproxy-forwardinvocatio/</link>
		<comments>http://rel.me/2009/05/22/nsinvocation-nsproxy-forwardinvocatio/#comments</comments>
		<pubDate>Fri, 22 May 2009 06:10:50 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://rel.me/?p=215</guid>
		<description><![CDATA[Typically when you want to invoke methods on a separate thread, with a delay, back on the main thread after a long operation, etc,  you are stuck with the performSelector:onThread: methods. With performSelector you are limited to invoking with a limited number of arguments, which must be objects; it won&#8217;t auto-unbox NSValue/NSNumber/NSNull like key value [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=215&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Typically when you want to invoke methods on a separate thread, with a delay, back on the main thread after a long operation, etc,  you are stuck with the performSelector:onThread: methods. With performSelector you are limited to invoking with a limited number of arguments, which must be objects; it won&#8217;t auto-unbox NSValue/NSNumber/NSNull like key value coding does.</p>
<p>This limitation can be really frustrating, particularly when you are using NSOperation or threading in general and need your delegates to call back onto the main (UI) thread.</p>
<p>A possible solution is to use NSInvocation with performSelector to deal with multiple arguments and primitives, for example:</p>
<pre>
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(listWithOffset:limit:)]];
[theInvocation setSelector:@selector(listWithOffset:limit:)];
[theInvocation setTarget:self];
NSInteger offset = 40;
[theInvocation setArgument:&amp;offset atIndex:2];
NSInteger limit = 20;
[theInvocation setArgument:&amp;limit atIndex:3];
[invocation performSelector:@selector(invoke) onThread:thread withObject:nil waitUntilDone:NO];
</pre>
<p>but it gets cumbersome, especially setting up the invocation instance. (BTW, the first argument is at index 2 because of the hidden arguments self and _cmd.) Also you would need to call retainArguments if your arguments were objects, that may be released by the calling thread.</p>
<p>Thankfully there is a better way. In a post called &#8216;<a href="http://toxicsoftware.com/grab-that-invocation/">Grab that Invocation</a>&#8216; and later at Dave Dribbin&#8217;s post &#8216;<a href="http://www.dribin.org/dave/blog/archives/2008/05/22/invoke_on_main_thread/">Invoke on Main Thread</a>&#8216; we can see how to get an NSInvocation instance from an NSProxy/forwardInvocation: automatically; and now we can combine the proxy with performSelector:onThread: or any of the other peformSelector methods to invoke back on the main thread, invoke on other threads, delay invocation, or other more general <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">aspects</a> like timing methods, debugging, logging, or security.</p>
<p>You can find Dave Dribbins original <a href="http://www.dribin.org/dave/hg/DDFoundation/file/702f3ad9dc6f/lib/DDInvocationGrabber.m">DDInvocationGrabber</a> implementation in his <a href="http://www.dribin.org/dave/hg/DDFoundation/">DDFoundation</a> library.</p>
<p>I&#8217;ve expanded on it a bit in <a href="http://github.com/gabriel/gh-kit">GHKit</a>, (see <a href="http://github.com/gabriel/gh-kit/blob/master/Classes/GHNSInvocationProxy.h">GHNSInvocationProxy</a>) and plan on adding more features. If you use it with the <a href="http://github.com/gabriel/gh-kit/blob/master/Classes/GHNSObject+Invocation.h">GHNSObject+Invocation</a> category, it gets even better:</p>
<pre>
// Invoke after 2 second delay (useful for simulating slow operations)
[[self gh_proxyAfterDelay:2.0] listWithOffset:40 limit:20];

// Invoke on main thread (if you ran on a separate thread or NSOperation
// and wanted to call back the delegate on the main thread)
[self listWithOffset:40 limit:20 delegate:[delegate_ gh_proxyOnMainThread:YES]];
// Later, after listing, the connection invokes the delegate back on the 
// main thread
[delegate_ connection:self didListWithOffset:40 limit:20];

// Invoke on thread
[[self gh_proxyOnThread:thread waitUntilDone:NO] listWithOffset:40 limit:20];

// Time the invocation
NSTimeInterval time;
[[self gh_timedProxy:&amp;time] listWithOffset:40 limit:20];
NSLog(@"Took %0.2fs", time);
</pre>
<p>This category also includes other performSelector helpers (supporting var args and argument lists).</p>
<p>What might be some other ways to use this? Maybe an NSOperationProxy that allows you to queue and prioritize invocations, or more complex debugging or analytics proxies that can keep stats of certain activities.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/215/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=215&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2009/05/22/nsinvocation-nsproxy-forwardinvocatio/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit Testing Framework &amp; GUI for Mac OS X and iPhone (GHUnit)</title>
		<link>http://rel.me/2009/02/21/unit-testing-for-mac-os-x-and-iphone-ghunit/</link>
		<comments>http://rel.me/2009/02/21/unit-testing-for-mac-os-x-and-iphone-ghunit/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 08:08:35 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://rel.me/?p=197</guid>
		<description><![CDATA[I&#8217;ve always wondered why XCode doesn&#8217;t have a unit testing GUI like other IDEs, or why the SenTesting framework has to be such a pain to setup, with all its RunScript build phases, shell scripts, octest bundle insanity. After using the GTMTestCase for the iPhone (since SenTesting isn&#8217;t supported on the iPhone SDK) I decided [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=197&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve always wondered why XCode doesn&#8217;t have a unit testing GUI like other IDEs, or why the SenTesting framework has to be such a pain to setup, with all its RunScript build phases, shell scripts, octest bundle insanity.  After using the GTMTestCase for the iPhone (since SenTesting isn&#8217;t supported on the iPhone SDK) I decided to try to re-purpose some of the GTM Unit Testing code into a standalone testing framework and GUI that I could use on both my Mac OS X and iPhone projects.</p>
<p>GHUnit (pronounced <span class="pronchars"><span class="unicode">ˈ</span>gü-</span><span class="pronchars"><span class="unicode">ˈ</span>nit</span><span class="pronchars">, I guess?), hosted at <a href="http://github.com/gabriel/gh-unit/tree/master" target="_self">gabriel/gh-unit</a>, is meant to be installed as a framework, and run as an application in a separate Test target. The idea being that you can run and crash into the XCode debugger directly and utilize all the debugging techniques that you normally use. The test GUI should allow you to see test failures more clearly, view timings / stats and not have to go fishing for the build console window. And an automated way to view stack traces.<br />
</span></p>
<p>Details on how to use the framework are included in the <a href="http://github.com/gabriel/gh-unit/blob/master/README.md">README</a>.</p>
<div id="attachment_200" class="wp-caption aligncenter" style="width: 564px"><img class="size-full wp-image-200" title="GHUnit Test GUI for Mac OS X App" src="http://rel.me.s3.amazonaws.com/blog/gh-unit5.jpg" alt="GHUnit Test GUI for Mac OS X App" width="554" height="450" /><p class="wp-caption-text">GHUnit Test GUI for Mac OS X App</p></div>
<div id="attachment_201" class="wp-caption alignleft" style="width: 325px"><img class="size-full wp-image-201" title="Unit Test GUI for iPhone App" src="http://rel.me.s3.amazonaws.com/blog/gh-unit-iphone1.jpg" alt="Unit Test GUI for iPhone App" width="315" height="557" /><p class="wp-caption-text">Unit Test GUI for iPhone App</p></div>
<p>For the iPhone side, I included a similar GUI that runs the tests in the simulator.</p>
<p>GHUnit can be used as a standalone test framework (by subclassing GHTestCase), or with your existing SenTestCase tests or GTMTestCase tests.</p>
<p>So far its pretty basic, but I am using it on a couple projects and its been helping my development a bunch and letting me to write tests as I go without completely destroying my workflow or sanity.</p>
<p>Any feedback is appreciated and let me know if you have any problems with the install/embed instructions or in general. Also thanks to the <a href="http://code.google.com/p/google-toolbox-for-mac/source/browse/#svn/trunk/UnitTesting">GTM</a> peeps, on which much of this is based.</p>
<p>Maybe the next step is an XCode plugin?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=197&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2009/02/21/unit-testing-for-mac-os-x-and-iphone-ghunit/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/gh-unit5.jpg" medium="image">
			<media:title type="html">GHUnit Test GUI for Mac OS X App</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/gh-unit-iphone1.jpg" medium="image">
			<media:title type="html">Unit Test GUI for iPhone App</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting a useful stack trace from NSException#callStackReturnAddresses</title>
		<link>http://rel.me/2008/12/30/getting-a-useful-stack-trace-from-nsexception-callstackreturnaddresses/</link>
		<comments>http://rel.me/2008/12/30/getting-a-useful-stack-trace-from-nsexception-callstackreturnaddresses/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 08:27:15 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://rel.me/?p=175</guid>
		<description><![CDATA[Its always been a little painful when you get an exception and the debugger decides not to cooperate, leaving you with something like: Thanks! As far as I could work out, traditional methods of grabbing a symbolic stack trace don&#8217;t work on the iPhone. (If I am remembering right, I don&#8217;t think NSStackTraceKey exists in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=175&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Its always been a little painful when you get an exception and the debugger decides not to cooperate, leaving you with something like:</p>
<p><img src="http://rel.me.s3.amazonaws.com/blog/stacktrace.jpg" alt="Stack Trace" title="Stack Trace" width="556" height="512" class="aligncenter size-full wp-image-176" /></p>
<p>Thanks!</p>
<p>As far as I could work out, traditional methods of grabbing a <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Exceptions/Tasks/ControllingAppResponse.html#//apple_ref/doc/uid/20000473-DontLinkElementID_3">symbolic stack trace</a> don&#8217;t work on the iPhone. (If I am remembering right, I don&#8217;t think NSStackTraceKey exists in UIKit.)</p>
<p>A little while ago I hacked the GTMStackTrace from <a href="http://code.google.com/p/google-toolbox-for-mac/">google-toolbox-for-mac</a>, to lookup the symbolic stack trace from the call stack return addresses (<a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSException_Class/Reference/Reference.html#//apple_ref/occ/instm/NSException/callStackReturnAddresses">NSException#callStackReturnAddresses</a> introduced in 10.5) and print it out using <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/func/NSSetUncaughtExceptionHandler">NSSetUncaughtExceptionHandler</a>. Life has been a little bit easier ever since. Thankfully, the awesome people who work on GTM added it in themselves (see <a href="http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/GTMStackTrace.h?r=74#61">GTMStackTrace.h#61</a>). Here is how you might set it up, in main.m:</p>
<pre>
#ifdef DEBUG
#import 
#import "GTMStackTrace.h"

void exceptionHandler(NSException *exception) {
	NSLog(@"%@", GTMStackTraceFromException(exception));
}
#endif

int main(int argc, char *argv[]) {
    
#ifdef DEBUG
	NSLog(@"Debug enabled");	
	NSDebugEnabled = YES;
	NSZombieEnabled = YES;
	NSDeallocateZombies = NO;
	NSHangOnUncaughtException = YES;
	[NSAutoreleasePool enableFreedObjectCheck:YES];
	NSSetUncaughtExceptionHandler(&amp;exceptionHandler);
#endif	

	NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
	int retVal = UIApplicationMain(argc, argv, nil, nil);
	[pool release];
	return retVal;
}
</pre>
<p>For me, DEBUG is set in GCC_PREPROCESSOR_DEFINITIONS via the awesome GTM <a href="http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/?r=73#trunk/XcodeConfig/Project">xcconfg</a> files, which you should also be using. Hopefully, you should get a trace that looks like:</p>
<pre>
[Session started at 2008-12-30 00:10:13 -0800.]
2008-12-30 00:10:15.772 TestExceptionIPhone[8493:20b] Debug enabled
2008-12-30 00:10:15.830 TestExceptionIPhone[8493:20b] #0  0x92c5614b _NSExceptionSetRubyToken()  (/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation)
#1  0x9657ce3b objc_exception_throw()  (/usr/lib/libobjc.A.dylib)
#2  0x92c55f2b +[NSException raise:format:arguments:]  (/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation)
#3  0x92c55f6a +[NSException raise:format:]  (/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation)
#4  0x002350 +[TestExceptionIPhoneAppDelegate applicationDidFinishLaunching:]  (/Users/gabe/Library/Application Support/iPhone Simulator/User/Applications/586E48B6-B758-4DBD-A534-D6927DA74583/TestExceptionIPhone.app/TestExceptionIPhone)
#5  0x30a4e01a +[UIApplication performInitializationWithURL:asPanel:]  (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/System/Library/Frameworks/UIKit.framework/UIKit)
#6  0x30a57363 +[UIApplication _runWithURL:]  (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/System/Library/Frameworks/UIKit.framework/UIKit)
#7  0x900425ee +[NSRunLoop runMode:beforeDate:]  (/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation)
#8  0x92bdcb45 CFRunLoopRunSpecific()  (/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation)
#9  0x92bdccf8 CFRunLoopRunInMode()  (/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation)
#10 0x31564600 GSEventRunModal()  (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices)
#11 0x315646c5 GSEventRun()  (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices)
#12 0x30a4ec98 +[UIApplication _run]  (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/System/Library/Frameworks/UIKit.framework/UIKit)
#13 0x30a5a094 UIApplicationMain()  (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk/System/Library/Frameworks/UIKit.framework/UIKit)
2008-12-30 00:10:15.834 TestExceptionIPhone[8493:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Give me a good stack trace'
</pre>
<p>And the source of the exception usually starts around the 5th line.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=175&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2008/12/30/getting-a-useful-stack-trace-from-nsexception-callstackreturnaddresses/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>

		<media:content url="http://rel.me.s3.amazonaws.com/blog/stacktrace.jpg" medium="image">
			<media:title type="html">Stack Trace</media:title>
		</media:content>
	</item>
		<item>
		<title>Shrub: S3 Proxy Service on Google App Engine</title>
		<link>http://rel.me/2008/09/23/shrub-s3-proxy-service-on-google-app-engine/</link>
		<comments>http://rel.me/2008/09/23/shrub-s3-proxy-service-on-google-app-engine/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 01:10:45 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[opentape]]></category>

		<guid isPermaLink="false">http://rel.me/?p=151</guid>
		<description><![CDATA[Shrub is a simple proxy to S3 to provide an RSS feed or HTML listing of files in a bucket or directory. Also, JSON, mixtape and ID3 lookups (more on that below). Me and my friends have been using it for a little while to keep track of when we are uploading files (via RSS) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=151&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://shrub.appspot.com">Shrub</a> is a simple proxy to S3 to provide an RSS feed or HTML listing of files in a bucket or directory. Also, JSON, mixtape and ID3 lookups (more on that below).</p>
<p>Me and my friends have been using it for a little while to keep track of when we are uploading files (via RSS) and it seems to work pretty well.</p>
<p>Last week, I was playing around with the idea of a <a href="http://muxtape.com">MuxTape</a>/<a href="http://opentape.fm">OpenTape</a> type format where you could point it at a directory of mp3&#8242;s and you could play them straight from the browser. I have a preliminary version, an example of it, at: <a href="http://shrub.appspot.com/m1xes/sub-pop-mix-1/?format=tape">http://shrub.appspot.com/m1xes/sub-pop-mix-1/?format=tape</a> (songs from the official <a href="http://subpop.com/media/">Subpop Records</a> free downloads page). So it seems like an OK way to share mixtapes by hosting them on your own S3 account, or to just stream mp3&#8242;s that you have backed up from a web browser.</p>
<p>In order to get it to show the track information, I wrote a handler to pull ID3v2 tag info from the mp3s by doing a request using the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1">Range</a> header (which S3 supports) of the first 1024 bytes (Range: bytes=0-1024). I think most ID3v2 taggings are at the beginning of the mp3 (I think ID3v1 was at the end). For example, if you have the S3 file:</p>
<p><tt>sub-pop-mix-1/01-Dntel-The_Distance_(ft._Arthur&amp;Yu).mp3</tt></p>
<p>in the <tt>m1xes</tt> bucket, you can do an ID3 lookup using format=id3-json:</p>
<p><tt><a href="http://shrub.appspot.com/m1xes/sub-pop-mix-1/01-Dntel-The_Distance_%28ft._Arthur%26Yu%29.mp3?format=id3-json" rel="nofollow">http://shrub.appspot.com/m1xes/sub-pop-mix-1/01-Dntel-The_Distance_%28ft._Arthur%26Yu%29.mp3?format=id3-json</a></tt>:</p>
<pre>{ "album": "Dumb Luck",
  "performer": "Dntel",
  "title": "The Distance (Ft. Arthur &amp; Yu)",
  "track": "5/9",
  "year": null,
  "isTruncated": false }</pre>
<p>It will parse as much as it can from the first 1024 bytes of the mp3 (and isTruncated will be true, if there was more data after that). ID3 lookups are cached for 5 minutes.</p>
<p>Right now it doesn&#8217;t do any authentication (not sure if I want to store secret keys), so its only useful for public buckets and files. I think it makes sense to open source it and then add auth capability, and then people can configure it with their own keys and host it on their own app engine space. I will try to throw some code up on github really soon, after I re-factor some of my noobish python code.</p>
<p>Mainly, its just an excuse to help me learn python and play with <a href="http://www.makotemplates.org/">mako</a> and <a href="http://code.google.com/appengine/">google app engine</a>.</p>
<p>All this, and more detailed info is at: <a href="http://shrub.appspot.com/">http://shrub.appspot.com/</a>. If you see anything wacky, let me know.</p>
<p><strong>Update:</strong> The source is now available on github: <a title="gabriel/shrub" href="http://github.com/gabriel/shrub">gabriel/shrub</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/151/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=151&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2008/09/23/shrub-s3-proxy-service-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>
	</item>
		<item>
		<title>Cocoa Utils Kit</title>
		<link>http://rel.me/2008/08/07/cocoa-utils-kit/</link>
		<comments>http://rel.me/2008/08/07/cocoa-utils-kit/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 18:32:04 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://rel.me/?p=137</guid>
		<description><![CDATA[I pushed my Objective-C utility kit to github: gh-kit. Its a collection of some files I&#8217;ve found, some I wrote for S3Hub. There isn&#8217;t a ton of stuff there. In fact, it probably needs to be merged into another utils framework or obsoleted completely by someone else (like google toolbox for mac). But until then, it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=137&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I pushed my Objective-C utility kit to github: <a href="http://github.com/gabriel/gh-kit/tree/master">gh-kit</a>. Its a collection of some files I&#8217;ve found, some I wrote for S3Hub. There isn&#8217;t a ton of stuff there. In fact, it probably needs to be merged into another utils framework or obsoleted completely by someone else (like google toolbox for mac). But until then, it has some useful stuff like:</p>
<ul>
<li><a href="http://github.com/gabriel/gh-kit/tree/master/Classes/GHNSDate+Parsing.m">GHNSDate+Parsing.m</a>: Various RFC and ISO date formatting and parsing</li>
<li><a href="http://github.com/gabriel/gh-kit/tree/master/Classes/GHNSString+TimeInterval.m">GHNSString+TimeInterval.m</a>: Time ago in words</li>
<li><a href="http://github.com/gabriel/gh-kit/tree/master/Classes/GHViewAnimation.m">GHViewAnimation.m</a>: View animation helper.
</li>
<li><a href="http://github.com/gabriel/gh-kit/tree/master/Classes/GHNSString+HMAC.m">GHNSString+HMAC.m</a>: HMAC-SHA1 implementation which works on iPhone</li>
</ul>
<p>And other stuff for generating uuids, mime types, etc. I blogged earlier about the <a href="http://rel.me/2008/07/22/date-format-rfc82285010361123asctimeiso8601unicode35tr35-6/">date parsing</a> and <a href="http://rel.me/2008/06/09/time-ago-in-words-for-cocoa/">time ago in words</a>.</p>
<p>Also, be sure to checkout the <a title="google toolbox for mac" href="http://code.google.com/p/google-toolbox-for-mac">Google Toolbox For Mac</a> which is way comprehensive (definately check there first). Feel free to pick and choose stuff at will. All files from other sources should have their original licenses which should all be MIT-like.</p>
<p><em>PS, sorry about the crazy feed crossing before. If you want to switch to a &#8220;cleaner&#8221; feed you can use this url: <a href="http://feeds.feedburner.com/gabrielh">feeds.feedburner.com/gabrielh</a>. Google reader caches the feed entries on the other one, so those will likely live forever.</em></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/relme.wordpress.com/137/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/relme.wordpress.com/137/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=137&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2008/08/07/cocoa-utils-kit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>
	</item>
		<item>
		<title>Date format RFC822/850/1036/1123; asctime; ISO8601; Unicode#35(tr35-6); *#$*&amp;!</title>
		<link>http://rel.me/2008/07/22/date-format-rfc82285010361123asctimeiso8601unicode35tr35-6/</link>
		<comments>http://rel.me/2008/07/22/date-format-rfc82285010361123asctimeiso8601unicode35tr35-6/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 12:08:34 +0000</pubDate>
		<dc:creator>relme</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://ducktaper.com/?p=91</guid>
		<description><![CDATA[I had to deal with handling of various date formats for S3Hub and totally munged it the first couple passes. This post lists some things to be aware of when parsing and formatting HTTP and XML style dates correctly using the Cocoa API&#8217;s. HTTP Date Some quick background on HTTP dates first. S3 requires sending [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=91&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I had to deal with handling of various date formats for S3Hub and totally munged it the first couple passes. This post lists some things to be aware of when parsing and formatting HTTP and XML style dates correctly using the Cocoa API&#8217;s.</p>
<h4>HTTP Date</h4>
<p>Some quick background on HTTP dates first. S3 requires sending a &#8216;Date&#8217; header field as part of an authenticated request. (This and signing the request is a common countermeasure against a <a href="http://en.wikipedia.org/wiki/Replay_attack">replay attack</a>.) The spec says, the format of the date should be &#8220;one of the RFC 2616 formats (<a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a>)&#8221;.</p>
<blockquote>
<p>HTTP applications have historically allowed three different formats<br /> for the representation of date/time stamps:</p>
<p>Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123<br /> Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036<br /> Sun Nov  6 08:49:37 1994       ; ANSI C&#8217;s asctime() format</p>
<p>The first format is preferred as an Internet standard and represents<br /> a fixed-length subset of that defined by RFC 1123 [8] (an update to<br /> RFC 822 [9]). The second format is in common use, but is based on the<br /> obsolete RFC 850 [12] date format and lacks a four-digit year.<br /> HTTP/1.1 clients and servers that parse the date value MUST accept<br /> all three formats (for compatibility with HTTP/1.0), though they MUST<br /> only generate the RFC 1123 format for representing HTTP-date values<br /> in header fields. See section 19.3 for further information.</p>
</blockquote>
<p>So these are the standard formats. When sending a formatted date you should only use RFC1123 but should be able to handle any of the formats listed. This is just a way to maintain compatibility while trying to move everything to the latest format. If you are wondering what the difference is, RFC 1123 updated 822 by changing the time zone from hour format (±0000) to GMT format (GMT).</p>
<p>For example, the &#8216;Date&#8217; or &#8216;Expires&#8217; header fields for requests have this (RFC1123) format. Replies might have an HTTP date format in a Last-Modified or Date header as well.</p>
<h4>ISO Date</h4>
<p>XML data which has formatted date fields might use a date format which is defined by the ISO8601 standard and looks like &#8217;2006-02-03T16:45:09.000Z&#8217;.</p>
<h4>Date parsing in Cocoa</h4>
<p>Prior to 10.4, the Cocoa API supported &#8220;strftime-style conversion specifiers&#8221;. In 10.4, they added support for the <a href="http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns">Unicode Technical Standard #35</a> (version tr35-6).</p>
<p>The pre-10.4 strftime patterns look like: &#8220;%m/%d/%y&#8221; and the Unicode standard looks like &#8220;MM/dd/yyyy&#8221;. The default behavior (for backwards compatibility) is strftime format. In order to use the Unicode standard (which you will, its way better), you need to set the formatter behavior to <code>NSDateFormatterBehavior10_4</code> either by calling <tt>setFormatterBehavior</tt> or setting the classes formatter behavior globally. Do NOT use the <code>initWithDateFormat:allowNaturalLanguage:</code> constructor, because it will give you a pre-10.4 date formatter. Using the strftime style of pattern when configured for the 10.4 (Unicode) behavior will fail silently.</p>
<p>So fast forward a few weeks,  an S3Hub  user told me he was getting authentication errors (invalid signing) trying to connect. I couldn&#8217;t replicate the problem but I eventually got the raw HTTP request header it was sending and the Date header looked like.</p>
<p><tt>Fr, 06 Jun 2008 08:49:37 GMT</tt>.</p>
<p>Turns out the user is in Germany and when I change my locale to something German, I can reproduce the problem. Date formatters themselves can have specific styles (and symbols) that are modified by the locale. In the German locale the weekday symbol for friday is &#8216;Fr&#8217; instead of English locale which is &#8216;Fri&#8217;. So when you use a date formatter in this way (with day or month symbols, for example) make sure to set the locale to en_US. The final date formatter looks like:</p>
<pre>
NSDateFormatter *rfc1123DateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[rfc1123DateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[rfc1123DateFormatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]];
[rfc1123DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
[rfc1123DateFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss zzz"];
</pre>
<p><strong>Update</strong>: See <a href="http://github.com/gabriel/gh-kit/blob/master/Classes/GHNSDate+Parsing.m">GHNSDate+Parsing</a> gh-kit category on github for a collection of these date formatters.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/relme.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/relme.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/relme.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/relme.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rel.me&#038;blog=95947&#038;post=91&#038;subd=relme&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rel.me/2008/07/22/date-format-rfc82285010361123asctimeiso8601unicode35tr35-6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/5a4a4677b06f5f235d36e716c07835ec?s=96&#38;d=identicon" medium="image">
			<media:title type="html">relme</media:title>
		</media:content>
	</item>
	</channel>
</rss>
