<?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: Objective-C and the Properties of BOOL</title>
	<atom:link href="http://www.mindsizzlers.com/2010/04/objective-c-and-the-properties-of-bool/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mindsizzlers.com/2010/04/objective-c-and-the-properties-of-bool/</link>
	<description>Bringing Ideas to Life</description>
	<lastBuildDate>Tue, 06 Dec 2011 19:36:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Stuart</title>
		<link>http://www.mindsizzlers.com/2010/04/objective-c-and-the-properties-of-bool/comment-page-1/#comment-1322</link>
		<dc:creator>Stuart</dc:creator>
		<pubDate>Wed, 10 Nov 2010 16:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=405#comment-1322</guid>
		<description>&#039;Self&#039; is used to access properties for objects through accessors; without the use of &#039;self&#039; you end up setting an instance variable rather than a property.

Because BOOL is essentially a primitive type, &#039;self&#039; isn&#039;t necessary - a BOOL is an instance variable rather
than a property.  As such, a property declaration is only necessary if access is needed from other objects.  Internally, &#039;self.myBOOL&#039; and &#039;myBOOL&#039; reduce to the same thing because the accessor for primitive types should simply be &#039;assign&#039;.

Both work as you would expect and because we are dealing with primitives, there&#039;s no difference in the outcome between these two forms.  I&#039;m not aware of any convention here amongst Objective-C programmers, so my guess is that it comes down to your own preference!</description>
		<content:encoded><![CDATA[<p>&#8216;Self&#8217; is used to access properties for objects through accessors; without the use of &#8216;self&#8217; you end up setting an instance variable rather than a property.</p>
<p>Because BOOL is essentially a primitive type, &#8216;self&#8217; isn&#8217;t necessary &#8211; a BOOL is an instance variable rather<br />
than a property.  As such, a property declaration is only necessary if access is needed from other objects.  Internally, &#8216;self.myBOOL&#8217; and &#8216;myBOOL&#8217; reduce to the same thing because the accessor for primitive types should simply be &#8216;assign&#8217;.</p>
<p>Both work as you would expect and because we are dealing with primitives, there&#8217;s no difference in the outcome between these two forms.  I&#8217;m not aware of any convention here amongst Objective-C programmers, so my guess is that it comes down to your own preference!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zsolt</title>
		<link>http://www.mindsizzlers.com/2010/04/objective-c-and-the-properties-of-bool/comment-page-1/#comment-1320</link>
		<dc:creator>Zsolt</dc:creator>
		<pubDate>Wed, 10 Nov 2010 10:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.mindsizzlers.com/?p=405#comment-1320</guid>
		<description>Thanks for the quick tutorial Stuart.
Would you consider the code below as correctly using BOOL?
Would you go through property to set the BOOL var? I need to change the variable both from within the class and from a different class.

BOOL gatheringFeaturedDataBool;
@property (readwrite, assign) BOOL gatheringFeaturedDataBool;


@synthesize gatheringFeaturedDataBool;

self.gatheringFeaturedDataBool = NO;

if (!self.gatheringFeaturedDataBool) {
		[self networkCheckAndDecide];
}

Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks for the quick tutorial Stuart.<br />
Would you consider the code below as correctly using BOOL?<br />
Would you go through property to set the BOOL var? I need to change the variable both from within the class and from a different class.</p>
<p>BOOL gatheringFeaturedDataBool;<br />
@property (readwrite, assign) BOOL gatheringFeaturedDataBool;</p>
<p>@synthesize gatheringFeaturedDataBool;</p>
<p>self.gatheringFeaturedDataBool = NO;</p>
<p>if (!self.gatheringFeaturedDataBool) {<br />
		[self networkCheckAndDecide];<br />
}</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

