<?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: NSView with gradient background</title>
	<atom:link href="http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/</link>
	<description>Interesting things to share around software development, music and what else comes to mind</description>
	<lastBuildDate>Wed, 08 Sep 2010 18:37:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Berrie</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-6578</link>
		<dc:creator>Berrie</dc:creator>
		<pubDate>Sun, 28 Feb 2010 16:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-6578</guid>
		<description>You&#039;re right, that&#039;s what you get from migrating at some point. I took it out for clarities sake.</description>
		<content:encoded><![CDATA[<p>You&#8217;re right, that&#8217;s what you get from migrating at some point. I took it out for clarities sake.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Psi</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-6577</link>
		<dc:creator>Psi</dc:creator>
		<pubDate>Sun, 28 Feb 2010 15:17:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-6577</guid>
		<description>&quot;the code is based on the new garbage collection mechanism available in Objective-C 2.0, so there are no retain or release calls&quot;

Then what&#039;s that autorelease doing there? ;)</description>
		<content:encoded><![CDATA[<p>&#8220;the code is based on the new garbage collection mechanism available in Objective-C 2.0, so there are no retain or release calls&#8221;</p>
<p>Then what&#8217;s that autorelease doing there? <img src='http://www.katoemba.net/makesnosenseatall/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stream</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-4652</link>
		<dc:creator>Stream</dc:creator>
		<pubDate>Fri, 16 Oct 2009 12:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-4652</guid>
		<description>It would be be useful to have [self setNeedsDisplay:YES], [self displayIfNeeded]; calls within custom setters :)</description>
		<content:encoded><![CDATA[<p>It would be be useful to have [self setNeedsDisplay:YES], [self displayIfNeeded]; calls within custom setters <img src='http://www.katoemba.net/makesnosenseatall/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berrie</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-118</link>
		<dc:creator>Berrie</dc:creator>
		<pubDate>Wed, 16 Jul 2008 19:44:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-118</guid>
		<description>Again, well spotted. I&#039;ve corrected the property statement.</description>
		<content:encoded><![CDATA[<p>Again, well spotted. I&#8217;ve corrected the property statement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Demitri</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-116</link>
		<dc:creator>Demitri</dc:creator>
		<pubDate>Wed, 16 Jul 2008 12:07:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-116</guid>
		<description>Thanks for the code - this is nicely illustrative. One small error in the listing above: the third property statement should say &quot;angle&quot;, not &quot;value&quot;.

Cheers,

Demitri</description>
		<content:encoded><![CDATA[<p>Thanks for the code &#8211; this is nicely illustrative. One small error in the listing above: the third property statement should say &#8220;angle&#8221;, not &#8220;value&#8221;.</p>
<p>Cheers,</p>
<p>Demitri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berrie</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-97</link>
		<dc:creator>Berrie</dc:creator>
		<pubDate>Thu, 26 Jun 2008 05:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-97</guid>
		<description>Well spotted, I&#039;ve changed the example to fix these flaws.</description>
		<content:encoded><![CDATA[<p>Well spotted, I&#8217;ve changed the example to fix these flaws.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joan Lluch</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-96</link>
		<dc:creator>Joan Lluch</dc:creator>
		<pubDate>Wed, 25 Jun 2008 21:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-96</guid>
		<description>As far as I understand the code has some memory management flaws (even if you are using garbage collection)

[A] - The following line :  

startingColor = [NSColor colorWithCalibratedWhite:1.0 alpha:1.0];

can potentially produce a released object access since the NSColor will be autoreleased in the next run loop, so you need to include [startingColor retain] to avoid it, or simply use [self setStartingColor:[NSColor colorWithCalibratedWhite:1.0 alpha:1.0]] ; 

The code actually works because you use [myGradientView setStartingColor: ] in your controller, but the above code is still faulty.

[B] - The drawRect method produces a memory leak each time it is called (which may be potentially very often) because aGradient is never released. You must explicitly release it after using it (this is fine if garbage collection is enabled though)

Regards, :)

Joan</description>
		<content:encoded><![CDATA[<p>As far as I understand the code has some memory management flaws (even if you are using garbage collection)</p>
<p>[A] &#8211; The following line :  </p>
<p>startingColor = [NSColor colorWithCalibratedWhite:1.0 alpha:1.0];</p>
<p>can potentially produce a released object access since the NSColor will be autoreleased in the next run loop, so you need to include [startingColor retain] to avoid it, or simply use [self setStartingColor:[NSColor colorWithCalibratedWhite:1.0 alpha:1.0]] ; </p>
<p>The code actually works because you use [myGradientView setStartingColor: ] in your controller, but the above code is still faulty.</p>
<p>[B] &#8211; The drawRect method produces a memory leak each time it is called (which may be potentially very often) because aGradient is never released. You must explicitly release it after using it (this is fine if garbage collection is enabled though)</p>
<p>Regards, <img src='http://www.katoemba.net/makesnosenseatall/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Joan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berrie</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-3</link>
		<dc:creator>Berrie</dc:creator>
		<pubDate>Thu, 10 Jan 2008 05:57:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-3</guid>
		<description>Good point. Makes the code simpler and doesn&#039;t distract from the core message.&lt;br/&gt;&lt;br/&gt;I&#039;ve updated the code in the posting.</description>
		<content:encoded><![CDATA[<p>Good point. Makes the code simpler and doesn&#8217;t distract from the core message.</p>
<p>I&#8217;ve updated the code in the posting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.katoemba.net/makesnosenseatall/2008/01/09/nsview-with-gradient-background/comment-page-1/#comment-2</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 10 Jan 2008 00:22:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.katoemba.net/makesnosenseatall/index.php/2008/01/09/nsview-with-gradient-background/#comment-2</guid>
		<description>If you are using objc-c 2.0 then why not use properties?  Get rid of the setters and have in interface:
@property(copy) NSColor *startingColor;
@property(copy) NSColor *endingColor;
@property(assign) int angle;

then in implementation section:
@synthesize startingColor, endingColor, angle;

But will be good to see article on using NSGradient with buttons.</description>
		<content:encoded><![CDATA[<p>If you are using objc-c 2.0 then why not use properties?  Get rid of the setters and have in interface:<br />
@property(copy) NSColor *startingColor;<br />
@property(copy) NSColor *endingColor;<br />
@property(assign) int angle;</p>
<p>then in implementation section:<br />
@synthesize startingColor, endingColor, angle;</p>
<p>But will be good to see article on using NSGradient with buttons.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
