<?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: Your Own Delegation Protocol</title>
	<atom:link href="http://www.cocoanetics.com/2009/07/your-own-delegation-protocol/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cocoanetics.com/2009/07/your-own-delegation-protocol/</link>
	<description>Our DNA is written in Objective-C</description>
	<lastBuildDate>Mon, 14 May 2012 19:43:35 +0100</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: SubstanceG</title>
		<link>http://www.cocoanetics.com/2009/07/your-own-delegation-protocol/#comment-1399</link>
		<dc:creator>SubstanceG</dc:creator>
		<pubDate>Fri, 14 Aug 2009 17:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.drobnik.com/touch/?p=1138#comment-1399</guid>
		<description>Ah, cheers, understood. I still have a lot to learn :-D</description>
		<content:encoded><![CDATA[<p>Ah, cheers, understood. I still have a lot to learn <img src='http://www.cocoanetics.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: drops</title>
		<link>http://www.cocoanetics.com/2009/07/your-own-delegation-protocol/#comment-1398</link>
		<dc:creator>drops</dc:creator>
		<pubDate>Fri, 14 Aug 2009 17:33:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.drobnik.com/touch/?p=1138#comment-1398</guid>
		<description>You are correct if the label is generated via code. But in this case it is instantiated from a XIB, thus an outlet is necessary.</description>
		<content:encoded><![CDATA[<p>You are correct if the label is generated via code. But in this case it is instantiated from a XIB, thus an outlet is necessary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SubstanceG</title>
		<link>http://www.cocoanetics.com/2009/07/your-own-delegation-protocol/#comment-1397</link>
		<dc:creator>SubstanceG</dc:creator>
		<pubDate>Fri, 14 Aug 2009 17:20:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.drobnik.com/touch/?p=1138#comment-1397</guid>
		<description>Hi, useful article - thanks.

Quick question, in the code snippit:

@interface AudioTestViewController : UIViewController  {
	IBOutlet UILabel *pluggedLabel;

	AudioNotifications *myNot;

}

@property (nonatomic, retain) IBOutlet UILabel *pluggedLabel;

@end

...do I really need the &quot;IBOutlet&quot; inside the interface declaration? Won&#039;t it be ok, *only* to have it in the property declaration later?</description>
		<content:encoded><![CDATA[<p>Hi, useful article &#8211; thanks.</p>
<p>Quick question, in the code snippit:</p>
<p>@interface AudioTestViewController : UIViewController  {<br />
	IBOutlet UILabel *pluggedLabel;</p>
<p>	AudioNotifications *myNot;</p>
<p>}</p>
<p>@property (nonatomic, retain) IBOutlet UILabel *pluggedLabel;</p>
<p>@end</p>
<p>&#8230;do I really need the &#8220;IBOutlet&#8221; inside the interface declaration? Won&#8217;t it be ok, *only* to have it in the property declaration later?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oleb.de/</title>
		<link>http://www.cocoanetics.com/2009/07/your-own-delegation-protocol/#comment-1396</link>
		<dc:creator>oleb.de/</dc:creator>
		<pubDate>Fri, 17 Jul 2009 08:26:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.drobnik.com/touch/?p=1138#comment-1396</guid>
		<description>Sorry, that should read:

@protocol AudioNotificationsDelegate &lt;NSObject&gt;

Your comment system ate the angle brackets.</description>
		<content:encoded><![CDATA[<p>Sorry, that should read:</p>
<p>@protocol AudioNotificationsDelegate &lt;NSObject&gt;</p>
<p>Your comment system ate the angle brackets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oleb.de/</title>
		<link>http://www.cocoanetics.com/2009/07/your-own-delegation-protocol/#comment-1395</link>
		<dc:creator>oleb.de/</dc:creator>
		<pubDate>Fri, 17 Jul 2009 08:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.drobnik.com/touch/?p=1138#comment-1395</guid>
		<description>Nice article. I have two additions:

&lt;i&gt;&quot;It seems to be standard to not retain the delegate but only assign it. Don’t ask me why.&quot;&lt;/i&gt;

Because in most cases, the delegate owns (and therefore retains) the delegating object. If both objects retained each other, the delegate would not be deallocated when it is released by its own parent (because its retain count is still &gt; 0). In the end, both delegate and delegating object will never be deallocated.

&lt;i&gt;&quot;But in order to be able to use the respondsToSelector method I found I needed to cast it to an NSObject.&quot;&lt;/i&gt;

You can avoid the NSObject type cast by requiring your protocol to conform to the NSObject protocol:

@protocol AudioNotificationsDelegate
...
@end

NSObject is not only a class but there is also an NSObject protocol that declares the same methods as the class. Thus, every NSObject subclass conforms to the NSObject protocol. In practice, including  in your protocol definition means that your delegate must be an instance of an NSObject subclass.</description>
		<content:encoded><![CDATA[<p>Nice article. I have two additions:</p>
<p><i>&#8220;It seems to be standard to not retain the delegate but only assign it. Don’t ask me why.&#8221;</i></p>
<p>Because in most cases, the delegate owns (and therefore retains) the delegating object. If both objects retained each other, the delegate would not be deallocated when it is released by its own parent (because its retain count is still &gt; 0). In the end, both delegate and delegating object will never be deallocated.</p>
<p><i>&#8220;But in order to be able to use the respondsToSelector method I found I needed to cast it to an NSObject.&#8221;</i></p>
<p>You can avoid the NSObject type cast by requiring your protocol to conform to the NSObject protocol:</p>
<p>@protocol AudioNotificationsDelegate<br />
&#8230;<br />
@end</p>
<p>NSObject is not only a class but there is also an NSObject protocol that declares the same methods as the class. Thus, every NSObject subclass conforms to the NSObject protocol. In practice, including  in your protocol definition means that your delegate must be an instance of an NSObject subclass.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

