<?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>bunnyhero dev &#187; objective-c</title>
	<atom:link href="http://www.bunnyhero.org/tag/objective-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bunnyhero.org</link>
	<description>Notes on iPhone, Flash and Web development</description>
	<lastBuildDate>Tue, 31 Aug 2010 20:51:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iPhone newbie lessons</title>
		<link>http://www.bunnyhero.org/2009/03/20/iphone-newbie-lessons/</link>
		<comments>http://www.bunnyhero.org/2009/03/20/iphone-newbie-lessons/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 22:54:42 +0000</pubDate>
		<dc:creator>bunnyhero</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[newbie]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.bunnyhero.org/?p=138</guid>
		<description><![CDATA[It&#8217;s been a long time since I messed around with Objective-C, even a little bit. A couple of things that have bitten me lately: @selector(apply:) is different than @selector(apply)! Note the lack of a colon in the second one. The colon means that there is one parameter to be passed with the message. No colon, no parameter. This makes a big difference when passing a selector as an argument to something like NSArray makeObjectsPerformSelector:. I keep forgetting to pass nil as the terminating argument to methods like NSArray initWithObjects:. Forgetting the terminating nil will cause the iPhone to crash with a Bad Access exception as it runs off the end of the stack into the weeds. And one very valuable debugging tip I found here: how to find out what exception was thrown in the Xcode debugger. When an uncaught exception kills your iPhone app, Xcode doesn&#8217;t really have much information at that point. To remedy that, go to Run -&#62; Show -&#62; Breakpoints and in the Breakpoints window double-click on the entry that says &#8220;Double-Click for Symbol.&#8221; Enter &#8220;objc_exception_throw&#8221; and press Return. Now, when you run your app in the debugger, any exception will stop there and let you [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since I messed around with Objective-C, even a little bit.</p>
<p>A couple of things that have bitten me lately:
<ul>
<li><code>@selector(apply:)</code> is different than <code>@selector(apply)</code>! Note the lack of a colon in the second one. The colon means that there is one parameter to be passed with the message. No colon, no parameter. This makes a big difference when passing a selector as an argument to something like <code>NSArray makeObjectsPerformSelector:</code>.</li>
<li>I keep forgetting to pass <code>nil</code> as the terminating argument to methods like <code>NSArray initWithObjects:</code>. Forgetting the terminating <code>nil</code> will cause the iPhone to crash with a Bad Access exception as it runs off the end of the stack into the weeds.</li>
</ul>
<p>And one very valuable debugging tip I found here:<br />
<a href="http://stackoverflow.com/questions/384775/how-do-i-find-out-what-exception-was-thrown-in-the-xcode-debugger-for-iphone">how to find out what exception was thrown in the Xcode debugger</a>. When an uncaught exception kills your iPhone app, Xcode doesn&#8217;t really have much information at that point. To remedy that, go to <strong>Run -&gt; Show -&gt; Breakpoints</strong> and in the Breakpoints window double-click on the entry that says &#8220;Double-Click for Symbol.&#8221; Enter &#8220;<strong>objc_exception_throw</strong>&#8221; and press Return. Now, when you run your app in the debugger, any exception will stop there and let you see the exception type.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bunnyhero.org/2009/03/20/iphone-newbie-lessons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
