<?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: Cocoa Tutorial: NSOperation and NSOperationQueue</title>
	<atom:link href="http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/</link>
	<description>Taglines are for Windows programmers</description>
	<lastBuildDate>Wed, 10 Mar 2010 23:24:56 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-1088</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Sun, 23 Nov 2008 23:27:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-1088</guid>
		<description>&lt;p&gt;The comma is used to chain commands together on one line.  That is all that it does and it is a part of the C language.  I use it when I do releases so that I do not forget to set the pointer to nil.  This is a bit of protective coding to avoid accidently send a message to a released object.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The comma is used to chain commands together on one line.  That is all that it does and it is a part of the C language.  I use it when I do releases so that I do not forget to set the pointer to nil.  This is a bit of protective coding to avoid accidently send a message to a released object.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: CharlesAHunter</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-1087</link>
		<dc:creator>CharlesAHunter</dc:creator>
		<pubDate>Sun, 23 Nov 2008 22:44:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-1087</guid>
		<description>&lt;p&gt;I am curious about the comma in your dealloc routine between the release of targetURL and the assignment to nil. I have never seen comma syntax in this situation before and am wondering whether I&#039;m missing something? (Kernighan &amp; Ritchie, 1978, Appendix A.7.15) gives an example of comma syntax in an expression of &quot;f(a,(t=3,t+2),c)&quot; saying that f() is being pass three arguments: a, 5 and c. However, that is not what appears to be going on in this dealloc routine. Is it just a typo that happens to compile or is it more significant?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I am curious about the comma in your dealloc routine between the release of targetURL and the assignment to nil. I have never seen comma syntax in this situation before and am wondering whether I&#8217;m missing something? (Kernighan &amp; Ritchie, 1978, Appendix A.7.15) gives an example of comma syntax in an expression of &#8220;f(a,(t=3,t+2),c)&#8221; saying that f() is being pass three arguments: a, 5 and c. However, that is not what appears to be going on in this dealloc routine. Is it just a typo that happens to compile or is it more significant?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-171</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Thu, 27 Mar 2008 15:00:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-171</guid>
		<description>&lt;p&gt;brg,&lt;/p&gt;

&lt;p&gt;performSelectorOnMainThread &quot;works&quot; just like any other message call.  It is a message that is passed to an object.  In this example it is passed to the static reference to the AppDelegate.  However it could easily have been passed to any other NSObject.  When the receiver gets the message, it then makes a subsequent call &lt;i&gt;to itself&lt;/i&gt; on the main thread using the selector that was passed in.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>brg,</p>

<p>performSelectorOnMainThread &#8220;works&#8221; just like any other message call.  It is a message that is passed to an object.  In this example it is passed to the static reference to the AppDelegate.  However it could easily have been passed to any other NSObject.  When the receiver gets the message, it then makes a subsequent call <i>to itself</i> on the main thread using the selector that was passed in.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: brg</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-165</link>
		<dc:creator>brg</dc:creator>
		<pubDate>Thu, 27 Mar 2008 12:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-165</guid>
		<description>&lt;p&gt;How does performSelectorOnMainThread work ?&lt;/p&gt;

&lt;p&gt;Does it multi-cast the call to any object that implements the pageLoaded method (thats running in the main thread)?&lt;/p&gt;

&lt;p&gt;Or does it have magic knowledge to send it to the AppDelegate?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>How does performSelectorOnMainThread work ?</p>

<p>Does it multi-cast the call to any object that implements the pageLoaded method (thats running in the main thread)?</p>

<p>Or does it have magic knowledge to send it to the AppDelegate?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jpdann</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-51</link>
		<dc:creator>jpdann</dc:creator>
		<pubDate>Wed, 12 Mar 2008 18:51:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-51</guid>
		<description>&lt;p&gt;Of course, how stupid of me!  I should not post until I&#039;ve had a coffee.&lt;/p&gt;

&lt;p&gt;Thanks Marcus&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Of course, how stupid of me!  I should not post until I&#8217;ve had a coffee.</p>

<p>Thanks Marcus</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-48</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Wed, 12 Mar 2008 16:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-48</guid>
		<description>&lt;p&gt;NSURL, like NSString, is immutable therefore no copy is necessary since it is not possible for a user to alter an immutable object.&lt;/p&gt;

&lt;p&gt;However, unlike NSString, NSURL does not have a mutable subclass so there is no concern.  Therefore if you wanted to be crazy you could check to see if your incoming NSString is mutable and decide on a copy vs retain.  But, I seriously down that the difference between a string copy vs. retain is going to save you a whole lot of memory.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>NSURL, like NSString, is immutable therefore no copy is necessary since it is not possible for a user to alter an immutable object.</p>

<p>However, unlike NSString, NSURL does not have a mutable subclass so there is no concern.  Therefore if you wanted to be crazy you could check to see if your incoming NSString is mutable and decide on a copy vs retain.  But, I seriously down that the difference between a string copy vs. retain is going to save you a whole lot of memory.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jpdann</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-47</link>
		<dc:creator>jpdann</dc:creator>
		<pubDate>Wed, 12 Mar 2008 15:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-47</guid>
		<description>&lt;p&gt;Hi Marcus,&lt;/p&gt;

&lt;p&gt;I noticed that your targetURL property is retained instead of copied.  If you&#039;re going to be using this retained value in a new thread then why not copy it? Can the url change from under your feet, or does the NSOperation(Queue) system watch for that?&lt;/p&gt;

&lt;p&gt;I ask this as I have a routine that matches regexes in a large string, retaining the string would save memory, but the user can potentially edit the string in an NSTextView while the matching is taken place.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Jon&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Marcus,</p>

<p>I noticed that your targetURL property is retained instead of copied.  If you&#8217;re going to be using this retained value in a new thread then why not copy it? Can the url change from under your feet, or does the NSOperation(Queue) system watch for that?</p>

<p>I ask this as I have a routine that matches regexes in a large string, retaining the string would save memory, but the user can potentially edit the string in an NSTextView while the matching is taken place.</p>

<p>Thanks,</p>

<p>Jon</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jpdann</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-37</link>
		<dc:creator>jpdann</dc:creator>
		<pubDate>Wed, 05 Mar 2008 23:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-37</guid>
		<description>&lt;p&gt;Hi Marcus,&lt;/p&gt;

&lt;p&gt;Thanks for the quick response.  Glad to know my coding style isn&#039;t completely off.&lt;/p&gt;

&lt;p&gt;Jon&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Marcus,</p>

<p>Thanks for the quick response.  Glad to know my coding style isn&#8217;t completely off.</p>

<p>Jon</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matthieu Cormier</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-36</link>
		<dc:creator>Matthieu Cormier</dc:creator>
		<pubDate>Wed, 05 Mar 2008 22:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-36</guid>
		<description>&lt;p&gt;Hi Marcus,&lt;/p&gt;

&lt;p&gt;Great tutorial, saved me some time learning one of the many ways to do threading in OS X.&lt;/p&gt;

&lt;p&gt;Some of your java terminology is a little off.  Interfaces in Java are like protocols in Objective-C so the metaphor is a bit of a stretch.  Nothing in the compiler is forcing you to implement -(void)main when you extend NSOperation.&lt;/p&gt;

&lt;p&gt;NSOperation is closer to an abstract adapter in Java (java.awt.event.MouseAdapter for example) where the required methods have been created and stubbed out.  You extend the class and override the methods you need.&lt;/p&gt;

&lt;p&gt;Oh yeah, and you don&#039;t override interface methods, you implement them ;)&lt;/p&gt;

&lt;p&gt;M@&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Marcus,</p>

<p>Great tutorial, saved me some time learning one of the many ways to do threading in OS X.</p>

<p>Some of your java terminology is a little off.  Interfaces in Java are like protocols in Objective-C so the metaphor is a bit of a stretch.  Nothing in the compiler is forcing you to implement -(void)main when you extend NSOperation.</p>

<p>NSOperation is closer to an abstract adapter in Java (java.awt.event.MouseAdapter for example) where the required methods have been created and stubbed out.  You extend the class and override the methods you need.</p>

<p>Oh yeah, and you don&#8217;t override interface methods, you implement them ;)</p>

<p>M@</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-26</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Mon, 03 Mar 2008 15:55:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-26</guid>
		<description>&lt;p&gt;Jon,&lt;/p&gt;

&lt;p&gt;I did that purely out of convenience as this is a contrived example.  However, there is nothing wrong with declaring a static if you expect it to stick around for the life of the application.&lt;/p&gt;

&lt;p&gt;I could have made it an ivar with the same effect.&lt;/p&gt;

&lt;p&gt;Marcus&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jon,</p>

<p>I did that purely out of convenience as this is a contrived example.  However, there is nothing wrong with declaring a static if you expect it to stick around for the life of the application.</p>

<p>I could have made it an ivar with the same effect.</p>

<p>Marcus</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jpdann</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-25</link>
		<dc:creator>jpdann</dc:creator>
		<pubDate>Mon, 03 Mar 2008 14:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-25</guid>
		<description>&lt;p&gt;Hi Marcus,&lt;/p&gt;

&lt;p&gt;Can you explain why you&#039;ve set the urlArray as static in the AppDelegate? Does this help with threading? It seems to violate memory management conventions as it doesn&#039;t get released.  Any advantage over making it an ivar? Or is it necessary as the AppDelegate is static, too?&lt;/p&gt;

&lt;p&gt;Jon&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Marcus,</p>

<p>Can you explain why you&#8217;ve set the urlArray as static in the AppDelegate? Does this help with threading? It seems to violate memory management conventions as it doesn&#8217;t get released.  Any advantage over making it an ivar? Or is it necessary as the AppDelegate is static, too?</p>

<p>Jon</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-7</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Thu, 21 Feb 2008 16:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-7</guid>
		<description>&lt;p&gt;You are correct, those two lines are reversed.  Thank you for pointing that out.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You are correct, those two lines are reversed.  Thank you for pointing that out.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: davearter</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-6</link>
		<dc:creator>davearter</dc:creator>
		<pubDate>Thu, 21 Feb 2008 11:28:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-6</guid>
		<description>&lt;p&gt;In the last code block, NSOperationQueue Concurrency, you send setMaxConcurrentOperationCount: to your queue object before initialising it... Is this correct?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In the last code block, NSOperationQueue Concurrency, you send setMaxConcurrentOperationCount: to your queue object before initialising it&#8230; Is this correct?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Zarra</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-3</link>
		<dc:creator>Marcus Zarra</dc:creator>
		<pubDate>Sun, 17 Feb 2008 16:33:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-3</guid>
		<description>&lt;p&gt;Yes the lack of the dot accessor syntax was intentional.  Why?  I truly dislike it.  I find it to be very jarring in the middle of all those Objective-C calls to start seeing what looks like C struct calls.&lt;/p&gt;

&lt;p&gt;Personally, I save the dot accessor calls for when I am dealing with C structs and use message calls when dealing with Objective-C objects and messages.  Keeps the code cleaner and easier to maintain.&lt;/p&gt;

&lt;p&gt;As for the garbage collection -- I am not using it any of my current projects so I do not, out of habit, use it in example projects.  I am sure that will change when I am finally able to use it in a production application -- or when I write a tutorial on it :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes the lack of the dot accessor syntax was intentional.  Why?  I truly dislike it.  I find it to be very jarring in the middle of all those Objective-C calls to start seeing what looks like C struct calls.</p>

<p>Personally, I save the dot accessor calls for when I am dealing with C structs and use message calls when dealing with Objective-C objects and messages.  Keeps the code cleaner and easier to maintain.</p>

<p>As for the garbage collection &#8212; I am not using it any of my current projects so I do not, out of habit, use it in example projects.  I am sure that will change when I am finally able to use it in a production application &#8212; or when I write a tutorial on it :)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: goron</title>
		<link>http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/comment-page-1/#comment-2</link>
		<dc:creator>goron</dc:creator>
		<pubDate>Sun, 17 Feb 2008 07:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/02/16/cocoa-tutorial-nsoperation-and-nsoperationqueue/#comment-2</guid>
		<description>&lt;p&gt;Just curious... you use the new property support (for targetURL) but then don&#039;t use the new property dot-accessor syntax.&lt;/p&gt;

&lt;p&gt;Intentional? Also you&#039;re not using the garbage collector. Together, these examples become rather verbose.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just curious&#8230; you use the new property support (for targetURL) but then don&#8217;t use the new property dot-accessor syntax.</p>

<p>Intentional? Also you&#8217;re not using the garbage collector. Together, these examples become rather verbose.</p>]]></content:encoded>
	</item>
</channel>
</rss>
