<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
	<channel>
<title>Mobile Discoveries</title><link>http://www.s3mobileapps.com/index.html</link><description>My mobile discoveries</description><dc:language>en</dc:language><dc:creator>Somya Jain</dc:creator><dc:rights>Coyright 2011&#x2c; Somya Jain</dc:rights><dc:date>2012-11-09T10:44:35-05:00</dc:date><admin:generatorAgent rdf:resource="http://www.realmacsoftware.com/" />
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<lastBuildDate>Mon, 12 Sep 2011 11:32:54 -0400</lastBuildDate><item><title>Dectect iOS Zombies in UnitTests via Instruments</title><dc:creator>Somya Jain</dc:creator><category>iOS</category><dc:date>2011-12-16T09:46:02-05:00</dc:date><link>http://www.s3mobileapps.com/blog/files/zombies_in_unit_tests.html#unique-entry-id-0</link><guid isPermaLink="true">http://www.s3mobileapps.com/blog/files/zombies_in_unit_tests.html#unique-entry-id-0</guid><content:encoded><![CDATA[<span style="font:12px Verdana, serif; color:#000000;">Ever get those pesky EXC_BAD_ACCESS errors due to over released memory in unit tests? For me, it was crashing octest, and other tests were not executing. Although, I could set a breakpoint in the debugger when this happened, but I wasn&rsquo;t able to figure out where this memory was allocated and when it was released. <br /><br />Here is how I found the root cause for my issue. I&rsquo;d love to hear if there is an easier way. <br /><br /></span><ul class="circle"><li><span style="font:12px Verdana, serif; color:#000000;">Step 1. Ensure </span><span style="font:12px Verdana, serif; color:#000000;"><a href="http://www.cocoadev.com/index.pl?NSZombieEnabled" rel="external" title="NSZombieEnabled">NSZombieEnabled=YES</a></span><span style="font:12px Verdana, serif; color:#000000;"> is set. Set up a breakpoint in setUp method of your unit test.</span></li><li><span style="font:12px Verdana, serif; color:#000000;">Step 2. Run the unit test in the simulator with a debugger (&#x2318U).</span></li><li><span style="font:12px Verdana, serif; color:#000000;">Step 3. After the breakpoint is hit. Launch Instruments and use the &ldquo;Zombies&rdquo; instrument.</span></li><li><span style="font:12px Verdana, serif; color:#000000;">Step 4. Select Target->Attach to Process and then select &ldquo;octest&rdquo;.</span></li><li><span style="font:12px Verdana, serif; color:#000000;">Step 5. Continue your code in Xcode, and watch as the zombie is detected and a flag is added in instruments. </span></li><li><span style="font:12px Verdana, serif; color:#000000;">Step 6. Double click on the flag to see where the memory was allocated and fix the issue.</span></li><li><span style="font:12px Verdana, serif; color:#000000;">Step 7. Repeat to ensure that the issue is fixed.</span></li></ul>]]></content:encoded></item></channel>
</rss>