<?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: iPhone Programming Part 2 : Objective C Memory Management</title>
	<atom:link href="http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/</link>
	<description>The Limits of My Language Mean the Limits of My World - Ludwig Wittgenstein</description>
	<lastBuildDate>Thu, 29 Jul 2010 12:25:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: links for 2009-09-04 &#124; Alones world</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-224</link>
		<dc:creator>links for 2009-09-04 &#124; Alones world</dc:creator>
		<pubDate>Sat, 05 Sep 2009 01:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-224</guid>
		<description>[...] coders» Blog Archive » iPhone Programming Part 2 : Objective C Memory Management (tags: iphone_dev objectivec memory iphone retain) [...]</description>
		<content:encoded><![CDATA[<p>[...] coders» Blog Archive » iPhone Programming Part 2 : Objective C Memory Management (tags: iphone_dev objectivec memory iphone retain) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-172</link>
		<dc:creator>Shawn</dc:creator>
		<pubDate>Tue, 23 Jun 2009 22:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-172</guid>
		<description>I found an answer to my question on StackOverflow... so for anyone that is interested:

You DO need to release it. See
&quot;As it rebuilds the object hierarchy, however, UIKit reestablishes connections between the objects using the setValue:forKey: method, which uses the available setter method or retains the object by default if no setter method is available.&quot; in Nib Object Retention

In other words, because you haven&#039;t specified these entries as @property (which implicitly declares a setter), or provided a setter directly, there is no available setter method, and the final part of this paragraph applies - the object is retained by default.</description>
		<content:encoded><![CDATA[<p>I found an answer to my question on StackOverflow&#8230; so for anyone that is interested:</p>
<p>You DO need to release it. See<br />
&#8220;As it rebuilds the object hierarchy, however, UIKit reestablishes connections between the objects using the setValue:forKey: method, which uses the available setter method or retains the object by default if no setter method is available.&#8221; in Nib Object Retention</p>
<p>In other words, because you haven&#8217;t specified these entries as @property (which implicitly declares a setter), or provided a setter directly, there is no available setter method, and the final part of this paragraph applies &#8211; the object is retained by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-171</link>
		<dc:creator>Shawn</dc:creator>
		<pubDate>Tue, 23 Jun 2009 22:49:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-171</guid>
		<description>What about an IBOutlet variable linked to an item in an Interface Builder nib?  I didn&#039;t think I was required to release them since I never explicitly created them with an alloc/init but I was seeing object allocations that were never released (and not reported by the Leaks tool) until I did.</description>
		<content:encoded><![CDATA[<p>What about an IBOutlet variable linked to an item in an Interface Builder nib?  I didn&#8217;t think I was required to release them since I never explicitly created them with an alloc/init but I was seeing object allocations that were never released (and not reported by the Leaks tool) until I did.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benoit Cerrina</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-96</link>
		<dc:creator>Benoit Cerrina</dc:creator>
		<pubDate>Sun, 15 Mar 2009 15:25:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-96</guid>
		<description>One thing I do to help manage autorelease pool is I create a c++ object which wraps one, allocating the autorelease pool in its constructor and releasing it in its destructor.  Then I can use instances of this object allocated on the stack to quickly create autorelease pools with a life time bounded by a given scope.  It makes for much less errors in case where there are several ways to exit a scope (like a loop with breaks and continues or a function with multiple returns)</description>
		<content:encoded><![CDATA[<p>One thing I do to help manage autorelease pool is I create a c++ object which wraps one, allocating the autorelease pool in its constructor and releasing it in its destructor.  Then I can use instances of this object allocated on the stack to quickly create autorelease pools with a life time bounded by a given scope.  It makes for much less errors in case where there are several ways to exit a scope (like a loop with breaks and continues or a function with multiple returns)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karmen Blake</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-89</link>
		<dc:creator>Karmen Blake</dc:creator>
		<pubDate>Fri, 13 Mar 2009 15:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-89</guid>
		<description>Great article.  Examples help a lot.</description>
		<content:encoded><![CDATA[<p>Great article.  Examples help a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iPhoneKicks.com</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-79</link>
		<dc:creator>iPhoneKicks.com</dc:creator>
		<pubDate>Sat, 07 Mar 2009 15:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-79</guid>
		<description>&lt;strong&gt;iPhone Programming: Objective C Memory Management ...&lt;/strong&gt;

You&#039;ve been kicked (a good thing) - Trackback from iPhoneKicks.com - iPhone SDK links, community driven...</description>
		<content:encoded><![CDATA[<p><strong>iPhone Programming: Objective C Memory Management &#8230;</strong></p>
<p>You&#8217;ve been kicked (a good thing) &#8211; Trackback from iPhoneKicks.com &#8211; iPhone SDK links, community driven&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aCoder</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-72</link>
		<dc:creator>aCoder</dc:creator>
		<pubDate>Wed, 04 Mar 2009 11:52:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-72</guid>
		<description>Yes, that helps. Thank you hhamm.</description>
		<content:encoded><![CDATA[<p>Yes, that helps. Thank you hhamm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hhamm</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-70</link>
		<dc:creator>hhamm</dc:creator>
		<pubDate>Tue, 03 Mar 2009 18:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-70</guid>
		<description>the retain counter will be increased only if you call the retain method. The same for the release method to decrease the retain counter. But there are some automatical created retain / release calls. If you use the &quot;@property (nonatomic, retain) NSObject * myVar;&quot; for example. In this case if you assign a value by using its setter method (e.g. &lt;b&gt;self.myVar = newValue&lt;/b&gt; or somewhere outside your class : &lt;b&gt;object.myVar = newValue&lt;/b&gt;) there will be an autorelease message to the previous value of myVar and a retain message to the new value. Also there are retain calls hidden in Apples Library Objects, especially the Collection classes.
Like if you add an object to a Dictionary it will receive a retain and vice versa if you remove it an autorelease (same on other collection classes like NSArray, NSMutableArray, etc.)

To understand the behaviour of release, retain, autorelease and so on, it helped me to write a simple sandbox class and override these methods with a simple NSLog output to see when a retain or release was called.

hope that helps you out?</description>
		<content:encoded><![CDATA[<p>the retain counter will be increased only if you call the retain method. The same for the release method to decrease the retain counter. But there are some automatical created retain / release calls. If you use the &#8220;@property (nonatomic, retain) NSObject * myVar;&#8221; for example. In this case if you assign a value by using its setter method (e.g. <b>self.myVar = newValue</b> or somewhere outside your class : <b>object.myVar = newValue</b>) there will be an autorelease message to the previous value of myVar and a retain message to the new value. Also there are retain calls hidden in Apples Library Objects, especially the Collection classes.<br />
Like if you add an object to a Dictionary it will receive a retain and vice versa if you remove it an autorelease (same on other collection classes like NSArray, NSMutableArray, etc.)</p>
<p>To understand the behaviour of release, retain, autorelease and so on, it helped me to write a simple sandbox class and override these methods with a simple NSLog output to see when a retain or release was called.</p>
<p>hope that helps you out?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aCoder</title>
		<link>http://www.gehacktes.net/2009/02/iphone-programming-part-2-objective-c-memory-management/comment-page-1/#comment-69</link>
		<dc:creator>aCoder</dc:creator>
		<pubDate>Tue, 03 Mar 2009 16:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.gehacktes.net/?p=262#comment-69</guid>
		<description>Is the retain counter of an object incremented when a new pointer point to it, or the retain method is required for the counter increment?</description>
		<content:encoded><![CDATA[<p>Is the retain counter of an object incremented when a new pointer point to it, or the retain method is required for the counter increment?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
