<?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: Mistakes I Made Using Bindings Without Core Data</title>
	<atom:link href="http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/</link>
	<description></description>
	<lastBuildDate>Fri, 25 Nov 2011 01:36:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: jobi</title>
		<link>http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/comment-page-1/#comment-267</link>
		<dc:creator>jobi</dc:creator>
		<pubDate>Sun, 11 Jun 2006 21:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/#comment-267</guid>
		<description>&lt;p&gt;The reason you have to use the workaround in 2) is that &quot;setIsIndeteriminate:&quot; is not the proper accessor for a value named &quot;indeterminate&quot;. From the KVC system&#039;s perspective, you are modifying indeterminate without warning (unless you call will/didChange). The proper name would have been &quot;setIndeterminate:&quot;; i.e. the value being set is &quot;indeterminate&quot;, not &quot;isIndeterminate&quot;.&lt;/p&gt;

&lt;p&gt;If you try to use setValue:forKey:, you&#039;ll probably see that your setter method won&#039;t be called (even though the variable will change, since in that case KVC just goes and muddles with your object directly).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The reason you have to use the workaround in 2) is that &#8220;setIsIndeteriminate:&#8221; is not the proper accessor for a value named &#8220;indeterminate&#8221;. From the KVC system&#8217;s perspective, you are modifying indeterminate without warning (unless you call will/didChange). The proper name would have been &#8220;setIndeterminate:&#8221;; i.e. the value being set is &#8220;indeterminate&#8221;, not &#8220;isIndeterminate&#8221;.</p>

<p>If you try to use setValue:forKey:, you&#8217;ll probably see that your setter method won&#8217;t be called (even though the variable will change, since in that case KVC just goes and muddles with your object directly).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: BrianC</title>
		<link>http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/comment-page-1/#comment-261</link>
		<dc:creator>BrianC</dc:creator>
		<pubDate>Wed, 07 Jun 2006 16:00:39 +0000</pubDate>
		<guid isPermaLink="false">http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/#comment-261</guid>
		<description>&lt;p&gt;Marcus, thanks for the comment. I actually like the getters and setters. I&#039;m not a fan of the &#039;setValue:forKey:&#039; stuff. I like seeing [self setIsIndeterminate:YES/NO] instead of the setValue:forKey stuff. I think the getters and setters read better and in most cases are worth their effort.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Marcus, thanks for the comment. I actually like the getters and setters. I&#8217;m not a fan of the &#8216;setValue:forKey:&#8217; stuff. I like seeing [self setIsIndeterminate:YES/NO] instead of the setValue:forKey stuff. I think the getters and setters read better and in most cases are worth their effort.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus S. Zarra</title>
		<link>http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/comment-page-1/#comment-260</link>
		<dc:creator>Marcus S. Zarra</dc:creator>
		<pubDate>Wed, 07 Jun 2006 15:24:33 +0000</pubDate>
		<guid isPermaLink="false">http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/#comment-260</guid>
		<description>&lt;p&gt;Going to have to disagree with you on number 2.  I have never had to call willChange and didChange inside of a set method.&lt;/p&gt;

&lt;p&gt;In fact, if you want some more magic instead, remove the getter and setter completely!  Try this at home...&lt;/p&gt;

&lt;p&gt;In your interface:&lt;/p&gt;

&lt;p&gt;BOOL isIndeteriminate;&lt;/p&gt;

&lt;p&gt;When you want to change this value:&lt;/p&gt;

&lt;p&gt;[self setValue:[NSNumber numberWithBool:YES] forKey:@&quot;isIndeteriminate&quot;];&lt;/p&gt;

&lt;p&gt;It will update the value AND notify any listeners that the value has changed.  To read the value call:&lt;/p&gt;

&lt;p&gt;[[self valueForKey:@&quot;isIndeteriminate&quot;] boolValue];&lt;/p&gt;

&lt;p&gt;Note: valueForKey is what IB uses to look up this value.&lt;/p&gt;

&lt;p&gt;There is no need (at least in Tiger, have not messed with 10.3 in a while) for simple getters and setters.&lt;/p&gt;

&lt;p&gt;Even without using these methods, there should be no reason to use willChange and didChange in your setter.  The setter handles the notification for you &quot;automagically&quot;.&lt;/p&gt;

&lt;p&gt;Marcus S. Zarra
Zarra Studios LLC
www.zarrastudios.com
Simply Elegant Software for OS X&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Going to have to disagree with you on number 2.  I have never had to call willChange and didChange inside of a set method.</p>

<p>In fact, if you want some more magic instead, remove the getter and setter completely!  Try this at home&#8230;</p>

<p>In your interface:</p>

<p>BOOL isIndeteriminate;</p>

<p>When you want to change this value:</p>

<p>[self setValue:[NSNumber numberWithBool:YES] forKey:@&#8221;isIndeteriminate&#8221;];</p>

<p>It will update the value AND notify any listeners that the value has changed.  To read the value call:</p>

<p>[[self valueForKey:@"isIndeteriminate"] boolValue];</p>

<p>Note: valueForKey is what IB uses to look up this value.</p>

<p>There is no need (at least in Tiger, have not messed with 10.3 in a while) for simple getters and setters.</p>

<p>Even without using these methods, there should be no reason to use willChange and didChange in your setter.  The setter handles the notification for you &#8220;automagically&#8221;.</p>

<p>Marcus S. Zarra
Zarra Studios LLC
<a href="http://www.zarrastudios.com" rel="nofollow">http://www.zarrastudios.com</a>
Simply Elegant Software for OS X</p>]]></content:encoded>
	</item>
	<item>
		<title>By: BrianC</title>
		<link>http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/comment-page-1/#comment-258</link>
		<dc:creator>BrianC</dc:creator>
		<pubDate>Wed, 07 Jun 2006 14:23:12 +0000</pubDate>
		<guid isPermaLink="false">http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/#comment-258</guid>
		<description>&lt;p&gt;Thanks Jean-Fancois. I&#039;ve updated the post to point out that I was just wrong on that one (which is good).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks Jean-Fancois. I&#8217;ve updated the post to point out that I was just wrong on that one (which is good).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Francois Roy</title>
		<link>http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/comment-page-1/#comment-257</link>
		<dc:creator>Jean-Francois Roy</dc:creator>
		<pubDate>Wed, 07 Jun 2006 13:48:46 +0000</pubDate>
		<guid isPermaLink="false">http://roobasoft.com/blog/2006/06/07/mistakes-i-made-using-bindings-without-core-data-2/#comment-257</guid>
		<description>&lt;p&gt;This problem is stange to me, because the KVC documentation clearly states in http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/DataTypes.html that KVC will automatically wrap and unwrap BOOL as an NSNumber.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This problem is stange to me, because the KVC documentation clearly states in <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/DataTypes.html" rel="nofollow">http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/DataTypes.html</a> that KVC will automatically wrap and unwrap BOOL as an NSNumber.</p>]]></content:encoded>
	</item>
</channel>
</rss>

