<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Adding firstObject to NSArray</title>
	<atom:link href="http://troybrant.net/blog/2010/02/adding-firstobject-to-nsarray/feed/" rel="self" type="application/rss+xml" />
	<link>http://troybrant.net/blog/2010/02/adding-firstobject-to-nsarray/</link>
	<description>Mistakes and learnings of an iPhone developer</description>
	<lastBuildDate>Thu, 02 Sep 2010 07:22:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Foo</title>
		<link>http://troybrant.net/blog/2010/02/adding-firstobject-to-nsarray/comment-page-1/#comment-239</link>
		<dc:creator>Foo</dc:creator>
		<pubDate>Sat, 10 Apr 2010 19:06:02 +0000</pubDate>
		<guid isPermaLink="false">http://troybrant.net/blog/?p=66#comment-239</guid>
		<description>@Jill:

Well, at first glance your statement appears to be valid.
Yet upon further inspection you should notice a subtle difference between

[array objectAtIndex:0];
[array firstObject];

Try to run those two on an empty array.
Result: The former method will throw an exception whereas the latter (category) method does not, returning nil instead. Just like Apple&#039;s &quot;[array lastObject]&quot; uses to do it.

Summing up: [array objectAtIndex:0] != [array firstObject] and by that in no way &quot;pointless&quot;.</description>
		<content:encoded><![CDATA[<p>@Jill:</p>
<p>Well, at first glance your statement appears to be valid.<br />
Yet upon further inspection you should notice a subtle difference between</p>
<p>[array objectAtIndex:0];<br />
[array firstObject];</p>
<p>Try to run those two on an empty array.<br />
Result: The former method will throw an exception whereas the latter (category) method does not, returning nil instead. Just like Apple&#8217;s &#8220;[array lastObject]&#8221; uses to do it.</p>
<p>Summing up: [array objectAtIndex:0] != [array firstObject] and by that in no way &#8220;pointless&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jill</title>
		<link>http://troybrant.net/blog/2010/02/adding-firstobject-to-nsarray/comment-page-1/#comment-61</link>
		<dc:creator>Jill</dc:creator>
		<pubDate>Mon, 22 Feb 2010 04:00:56 +0000</pubDate>
		<guid isPermaLink="false">http://troybrant.net/blog/?p=66#comment-61</guid>
		<description>There&#039;s a reason there&#039;s no &quot;firstObject&quot;:  It&#039;s not needed.
Object #0 *ALWAYS* is the 1st object.
  
Doing all that extract/unneeded work... to create your own firstObject is like saying:
The first book on that shelf is the first book.
  
Your code is an excellent example of &quot;categories&quot;... but used in a pointless way.
  
&quot;Category&quot; is a VERY powerful thing.  Use it as such.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a reason there&#8217;s no &#8220;firstObject&#8221;:  It&#8217;s not needed.<br />
Object #0 *ALWAYS* is the 1st object.</p>
<p>Doing all that extract/unneeded work&#8230; to create your own firstObject is like saying:<br />
The first book on that shelf is the first book.</p>
<p>Your code is an excellent example of &#8220;categories&#8221;&#8230; but used in a pointless way.</p>
<p>&#8220;Category&#8221; is a VERY powerful thing.  Use it as such.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Owain Hunt</title>
		<link>http://troybrant.net/blog/2010/02/adding-firstobject-to-nsarray/comment-page-1/#comment-38</link>
		<dc:creator>Owain Hunt</dc:creator>
		<pubDate>Mon, 08 Feb 2010 22:31:34 +0000</pubDate>
		<guid isPermaLink="false">http://troybrant.net/blog/?p=66#comment-38</guid>
		<description>Nice. Goes well with my addition of simple sorting (http://owainrhunt.com/post/374809142). Sometimes the verbosity of ObjC is necessary, sometimes not.</description>
		<content:encoded><![CDATA[<p>Nice. Goes well with my addition of simple sorting (<a href="http://owainrhunt.com/post/374809142" rel="nofollow">http://owainrhunt.com/post/374809142</a>). Sometimes the verbosity of ObjC is necessary, sometimes not.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
