<?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: Introduction to Protocols</title>
	<atom:link href="http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html</link>
	<description>iOS Developer Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Wed, 08 Feb 2012 06:31:16 -0600</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: John Muchow</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-60295</link>
		<dc:creator>John Muchow</dc:creator>
		<pubDate>Sat, 17 Sep 2011 19:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-60295</guid>
		<description>Thanks Bowen, I really appreciate the kind words!</description>
		<content:encoded><![CDATA[<p>Thanks Bowen, I really appreciate the kind words!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bowen</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-60272</link>
		<dc:creator>Bowen</dc:creator>
		<pubDate>Sat, 17 Sep 2011 06:37:12 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-60272</guid>
		<description>I am seriously fascinated along with your writing skills as well as with the format on your blog. Is it a paid out design or do you personalize it all by yourself? In either case continue great top quality writing, it really is uncommon to see a good web site just like this these days..</description>
		<content:encoded><![CDATA[<p>I am seriously fascinated along with your writing skills as well as with the format on your blog. Is it a paid out design or do you personalize it all by yourself? In either case continue great top quality writing, it really is uncommon to see a good web site just like this these days..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank V.</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-2223</link>
		<dc:creator>Frank V.</dc:creator>
		<pubDate>Thu, 21 May 2009 14:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-2223</guid>
		<description>Eric, you are right.

Ref: http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocObjectsClasses.html#//apple_ref/doc/uid/TP30001163-CH11-SW3</description>
		<content:encoded><![CDATA[<p>Eric, you are right.</p>
<p>Ref: <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocObjectsClasses.html#//apple_ref/doc/uid/TP30001163-CH11-SW3" rel="nofollow">http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocObjectsClasses.html#//apple_ref/doc/uid/TP30001163-CH11-SW3</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Lloyd</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-2207</link>
		<dc:creator>Eric Lloyd</dc:creator>
		<pubDate>Thu, 21 May 2009 03:23:44 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-2207</guid>
		<description>dax,

I just spent some time fighting with this, trying to get the syntax right amid myriad unhelpful compiler messages. Correct me if I&#039;m wrong (I don&#039;t have my code in front of me right now), but I believe the &quot;*&quot; in &quot;id&lt;Fubar&gt; *fubar&quot; should not be there, since id is already by definition a pointer.
</description>
		<content:encoded><![CDATA[<p>dax,</p>
<p>I just spent some time fighting with this, trying to get the syntax right amid myriad unhelpful compiler messages. Correct me if I&#8217;m wrong (I don&#8217;t have my code in front of me right now), but I believe the &#8220;*&#8221; in &#8220;id&lt;Fubar&gt; *fubar&#8221; should not be there, since id is already by definition a pointer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-978</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Wed, 15 Apr 2009 18:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-978</guid>
		<description>dax, 

Thank you very much for taking the time to answer my question.  It is clear that I don&#039;t understand this part of Objective-C.  Time to go to the book store.  Again, thank you.

Regards,
Frank</description>
		<content:encoded><![CDATA[<p>dax, </p>
<p>Thank you very much for taking the time to answer my question.  It is clear that I don&#8217;t understand this part of Objective-C.  Time to go to the book store.  Again, thank you.</p>
<p>Regards,<br />
Frank</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dax</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-894</link>
		<dc:creator>dax</dc:creator>
		<pubDate>Mon, 13 Apr 2009 22:17:58 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-894</guid>
		<description>Another option, use the object placeholder “id” along with &#8249;Fubar&#8250;, to typecheck that you want any object that conforms to Fubar protocol:
id &#8249;Fubar&#8250; *fubar = [[AnotherClass alloc] init];</description>
		<content:encoded><![CDATA[<p>Another option, use the object placeholder “id” along with &lsaquo;Fubar&rsaquo;, to typecheck that you want any object that conforms to Fubar protocol:<br />
id &lsaquo;Fubar&rsaquo; *fubar = [[AnotherClass alloc] init];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dax</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-893</link>
		<dc:creator>dax</dc:creator>
		<pubDate>Mon, 13 Apr 2009 22:14:30 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-893</guid>
		<description>[Regarding your question, Frank...]

Your example would attempt to make a Fubar class pointer called fubar and point it at AnotherClass instance, which shouldn&#039;t work as no Fubar class was defined

To explicitly check if the class conforms to Fubar you can use conformsToProtocol:
if ([AnotherClass conformsToProtocol;@protocol(Fubar)]) {
  AnotherClass *fubar = [[AnotherClass alloc] init];
}

Another option, use the object placeholder &quot;id&quot; along with , to typecheck that you want any object that conforms to Fubar protocol:
id  *fubar = [[AnotherClass alloc]init];

If AnotherClass doesn&#039;t conform to Fubar then you will receive a compiler error</description>
		<content:encoded><![CDATA[<p>[Regarding your question, Frank...]</p>
<p>Your example would attempt to make a Fubar class pointer called fubar and point it at AnotherClass instance, which shouldn&#8217;t work as no Fubar class was defined</p>
<p>To explicitly check if the class conforms to Fubar you can use conformsToProtocol:<br />
if ([AnotherClass conformsToProtocol;@protocol(Fubar)]) {<br />
  AnotherClass *fubar = [[AnotherClass alloc] init];<br />
}</p>
<p>Another option, use the object placeholder &#8220;id&#8221; along with , to typecheck that you want any object that conforms to Fubar protocol:<br />
id  *fubar = [[AnotherClass alloc]init];</p>
<p>If AnotherClass doesn&#8217;t conform to Fubar then you will receive a compiler error</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://iPhoneDeveloperTips.com/cocoa/introduction-to-protocols.html#comment-578</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Mon, 06 Apr 2009 21:09:12 +0000</pubDate>
		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1988#comment-578</guid>
		<description>So, a question if you don&#039;t mind. You said that protocols are analogous interfaces which is what I thought.

Since this is true, does that mean that the polymorphism works the same way on Protocols as they do as Java Interfaces? Using your Fubar example, could I do the following:

&lt;code&gt;
   Fubar *fubar = [[AnotherClass alloc] init]; 

   int RetVal = [fubar status];

   [fubar release];  //Also, would I have access to release ?
&lt;/code&gt;

Please excuse the quick example and I&#039;m sorry if the Objective-C isn&#039;t quite right. I&#039;m still learning it...

Thank you,
Frank</description>
		<content:encoded><![CDATA[<p>So, a question if you don&#8217;t mind. You said that protocols are analogous interfaces which is what I thought.</p>
<p>Since this is true, does that mean that the polymorphism works the same way on Protocols as they do as Java Interfaces? Using your Fubar example, could I do the following:</p>
<p><code><br />
   Fubar *fubar = [[AnotherClass alloc] init]; </p>
<p>   int RetVal = [fubar status];</p>
<p>   [fubar release];  //Also, would I have access to release ?<br />
</code></p>
<p>Please excuse the quick example and I&#8217;m sorry if the Objective-C isn&#8217;t quite right. I&#8217;m still learning it&#8230;</p>
<p>Thank you,<br />
Frank</p>
]]></content:encoded>
	</item>
</channel>
</rss>

