<?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>A2 Apps &#187; Idioms</title>
	<atom:link href="http://a2apps.com.au/tag/idioms/feed/" rel="self" type="application/rss+xml" />
	<link>http://a2apps.com.au</link>
	<description></description>
	<lastBuildDate>Sun, 10 Mar 2013 08:52:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Easily testing if a string is nil or empty</title>
		<link>http://a2apps.com.au/easily-testing-if-a-string-is-nil-or-empty/</link>
		<comments>http://a2apps.com.au/easily-testing-if-a-string-is-nil-or-empty/#comments</comments>
		<pubDate>Tue, 26 Feb 2013 13:16:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iOS Snippets]]></category>
		<category><![CDATA[Idioms]]></category>
		<category><![CDATA[NSString]]></category>

		<guid isPermaLink="false">http://a2apps.com.au/?p=95</guid>
		<description><![CDATA[A very common idiom: Works because calling a method on nil is not an error &#8211; just silently returns nil, which is also false.]]></description>
				<content:encoded><![CDATA[<p>A very common idiom:</p>
<pre class="brush: objc; title: ; notranslate">

if ([string length]) {

// It's a string of at least one char, and is not null.

}
</pre>
<p>Works because calling a method on nil is not an error &#8211; just silently returns nil, which is also false.</p>
]]></content:encoded>
			<wfw:commentRss>http://a2apps.com.au/easily-testing-if-a-string-is-nil-or-empty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proper thread-safe singleton</title>
		<link>http://a2apps.com.au/proper-thread-safe-singleton/</link>
		<comments>http://a2apps.com.au/proper-thread-safe-singleton/#comments</comments>
		<pubDate>Tue, 26 Feb 2013 12:26:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iOS Snippets]]></category>
		<category><![CDATA[Idioms]]></category>

		<guid isPermaLink="false">http://a2apps.com.au/?p=65</guid>
		<description><![CDATA[The following is a correct thread-safe implementation of the singleton +sharedInstance method, which relies on GCD:]]></description>
				<content:encoded><![CDATA[<p>The following is a correct thread-safe implementation of the singleton +sharedInstance method, which relies on GCD:</p>
<pre class="brush: objc; title: ; notranslate">

+ (id)sharedInstance;
{
 static id sharedInstance = nil;
 static dispatch_once_t once = 0;
 dispatch_once(&amp;once,
 ^{ sharedInstance = [[self alloc] init]; }
 );
 return sharedInstance;
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://a2apps.com.au/proper-thread-safe-singleton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
