<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Corporation Unknown</title>
	<atom:link href="http://corporationunknown.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://corporationunknown.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 21 Feb 2012 06:21:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Define &#8220;Success&#8221;</title>
		<link>http://corporationunknown.com/blog/2012/02/20/define-success/</link>
		<comments>http://corporationunknown.com/blog/2012/02/20/define-success/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 05:47:59 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=310</guid>
		<description><![CDATA[What comes to mind when I say the word &#8220;success&#8221;? Everyone has their own definition: Advancing in one&#8217;s career; saving enough to retire; finding a significant other with whom to build a happy, healthy family. Complicating matters further, &#8220;success&#8221; has much finer-grained contexts: Each successive day of kicking a bad habit; completing a project milestone; [...]]]></description>
			<content:encoded><![CDATA[<p>What comes to mind when I say the word &#8220;success&#8221;?</p>
<p>Everyone has their own definition: Advancing in one&#8217;s career; saving enough to retire; finding a significant other with whom to build a happy, healthy family. Complicating matters further, &#8220;success&#8221; has much finer-grained contexts: Each successive day of kicking a bad habit; completing a project milestone; passing a test in school. Many &#8220;personal improvement&#8221; programs would even propose that &#8220;success&#8221; is only measurable as a continuing accumulation of completed milestones, not any one observable point in time.</p>
<p>So why in the world do you think you can capture &#8220;success&#8221; in a boolean?</p>
<pre class="code">BOOL success = [self doSomething];</pre>
<p>That method you just called actually did something, and it did something concrete: It deleted (or saved) a file on disk; parsed some JSON; validated an encrypted string.</p>
<p>Don&#8217;t try to capture success in a variable. Name your booleans for what the code actually accomplishes and you&#8217;ll find the following logic is much more readable with a decreased likelihood of logic bugs.</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2012/02/20/define-success/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gotcher Address Book!</title>
		<link>http://corporationunknown.com/blog/2012/02/09/gotcher-address-book/</link>
		<comments>http://corporationunknown.com/blog/2012/02/09/gotcher-address-book/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 22:25:20 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Mac Community]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=302</guid>
		<description><![CDATA[Even though I installed the Path app and set up an account, I never really used it. It never really clicked with me; I really only signed up because many people I know were trying/using it. So it wasn&#8217;t anything close to a &#8220;hardship&#8221; for me to ask them to delete my account when it [...]]]></description>
			<content:encoded><![CDATA[<p>Even though I installed the Path app and set up an account, I never really used it. It never really clicked with me; I really only signed up because many people I know were trying/using it. So it wasn&#8217;t anything close to a &#8220;hardship&#8221; for me to ask them to delete my account when it was <a href="http://mclov.in/2012/02/08/path-uploads-your-entire-address-book-to-their-servers.html">revealed that they were uploading the contents of my address book to their servers.</a> Still, I&#8217;m disappointed.</p>
<p>Last fall, we were in the crunch-time week for a client&#8217;s app before the iOS 5.0 submission deadline. I was profiling it in Instruments, trying to find where we could improve its launch-time performance, when I found a noticeable amount of time was spent in Address Book queries by a third-party video tracking library.</p>
<p>Not only was this behavior slowing down our launch, it was unexpected and&#8211;since it was a binary library without source code provided&#8211;we had no idea what it was doing with that information. A red flag was raised, and to my surprise the client even expressed willingness to cut the functionality until the questions could be answered.</p>
<p>As explained, the usage was almost clever: By adding a defined contact to your address book, you would unlock additional debug logging and reporting options for their SDK. They claimed that there were numerous applications already approved with this SDK, and I don&#8217;t feel the need to question their veracity. Most importantly, they offered a build without that functionality, provided it quickly, and that&#8217;s what shipped.</p>
<p>So it disappoints me that after my own personal experience of trying to keep code out of the Address Book, there are developers out there who apparently don&#8217;t think twice about slurping all of your contacts and sending them to their servers without your express permission.</p>
<p>This has <a href="http://isource.com/2008/07/23/aurora-feint-removed-from-app-store-over-privacy-concerns-hopefully-to-return-soon/">happened before with Aurora Feint.</a> It forever tainted my opinion of Open Feint, which came out of that. I had been under the impression that Apple was much more strict about this type of behavior&#8211;&#8221;chance of rejection&#8221; was one of the main reasons I brought attention to the library&#8217;s unexpected access. So I&#8217;m disappointed in Apple, too.</p>
<p>There have been calls for Apple to add required guards and notifications to the API&#8217;s access, similar to how Location Services is handled. That would probably be good, but at a certain point all the notifications just become &#8220;Grant Access?&#8221; alerts that users don&#8217;t think about. I think there&#8217;s a simpler way to do it, at least for a first attempt:</p>
<ol>
<li>When submitting an app to iTunes Connect, ask &#8220;Do you access and transmit Address Book data?&#8221; similar to the existing question about using encryption.</li>
<li>Answering &#8220;yes&#8221; is a flag to the review team to verify that the developers have implemented their own reasonable opt-in mechanism, and maybe even a bit more scrutiny of their network traffic.</li>
<li>If an app is found to be violating this, terminate the developer&#8217;s account.</li>
</ol>
<p>Yes, I feel that violating this expectation after making it clear that you are expected to be transparent about using this kind of information is worthy of booting you out of the App Store.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2012/02/09/gotcher-address-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Farewell, Steve Jobs</title>
		<link>http://corporationunknown.com/blog/2011/10/05/farewell-steve-jobs/</link>
		<comments>http://corporationunknown.com/blog/2011/10/05/farewell-steve-jobs/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 01:56:38 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Mac Community]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=298</guid>
		<description><![CDATA[Few depart this world having left a piece of themselves in so many others. I shall cherish my tiny share. Thank you, Mr. Jobs. Thank you, Jobs family, for sharing him with us.]]></description>
			<content:encoded><![CDATA[<p>Few depart this world having left a piece of themselves in so many others. I shall cherish my tiny share.</p>
<p>Thank you, Mr. Jobs. Thank you, Jobs family, for sharing him with us.</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2011/10/05/farewell-steve-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Fix Patents</title>
		<link>http://corporationunknown.com/blog/2011/05/18/how-to-fix-patents/</link>
		<comments>http://corporationunknown.com/blog/2011/05/18/how-to-fix-patents/#comments</comments>
		<pubDate>Wed, 18 May 2011 16:49:43 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=294</guid>
		<description><![CDATA[As I understand it, the intent of a patent is to protect the value of the invention to the inventor by giving them exclusive control of the rights to use said invention. In return, they are asked to encourage future innovation by sharing that information with the world instead of keeping it a proprietary secret. [...]]]></description>
			<content:encoded><![CDATA[<p>As I understand it, the intent of a patent is to protect the value of the invention to the inventor by giving them exclusive control of the rights to use said invention. In return, they are asked to encourage future innovation by sharing that information with the world instead of keeping it a proprietary secret. Pretty simple and straightforward, and I really have a hard time disagreeing with that being a desirable goal.</p>
<p>Most of the complaints about the patent system being &#8220;broken&#8221; come down to a few points:</p>
<ol>
<li>The patent is not novel; it&#8217;s an obvious method to anyone spending any mental effort on the problem space.</li>
<li>The patent is too broad; It could cover any number of possible techniques without taking a stand on one (or a handful). This usually seems to be done to get around the requirement of sharing the information, keeping aspects proprietary. One might also consider this related to &#8220;not novel.&#8221;</li>
<li>The inventor (or, usually, reassigned rights holder commonly referred to as &#8220;patent troll&#8221;) has done nothing with their rights to the patent on their own. On its own, there is nothing wrong with this&#8211;it would be perfectly legitimate to have a sole licensee. When combined with items 1 or 2, though, most people agree that it&#8217;s is predatory and stifles innovation rather than encouraging it.</li>
</ol>
<p>My Proposal: Within a defined grace period after patent status is granted (I&#8217;m envisioning 5 years, maybe 7), the patent holder must show measurable revenue due to a concrete implementation of the patent, or that it is a recognizable part of another product which generates recognizable revenue. This revenue may be recognized directly by the inventor, or by licensees of the patent. If such evidence is not given within the grace period, the patent is considered fallow and control rights are revoked.</p>
<p>A patent that does not result in a concrete implementation within a reasonable period of time is hard to consider as &#8220;benefitting society&#8221; and thus unworthy of the rights exclusivity granted by the society in exchange.</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2011/05/18/how-to-fix-patents/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>It Lives!</title>
		<link>http://corporationunknown.com/blog/2011/04/24/it-lives/</link>
		<comments>http://corporationunknown.com/blog/2011/04/24/it-lives/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 00:35:51 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=289</guid>
		<description><![CDATA[(There is no Easter-related content here; the timing is pure coincidence.) I just received word that the 2.0 update to ESPN Passport&#8211;the last fruits of my contracting with the fine folks of RogueSheep before joining Black Pixel&#8211;went live on the App Store today. What started out as &#8220;add Facebook Places functionality&#8221; became a much smoother, [...]]]></description>
			<content:encoded><![CDATA[<p>(There is no Easter-related content here; the timing is pure coincidence.)</p>
<p>I just received word that the <a href="http://itunes.apple.com/us/app/espn-passport/id382744201?mt=8">2.0 update to ESPN Passport</a>&#8211;the last fruits of my contracting with the fine folks of <a href="http://www.roguesheep.com/">RogueSheep</a> before joining <a href="http://www.blackpixel.com/">Black Pixel</a>&#8211;went live on the App Store today. What started out as &#8220;add Facebook Places functionality&#8221; became a much smoother, more efficient and focused application that I was proud to have a part in.</p>
<p>If you&#8217;re at all interested in adding a social network aspect to your sports watching, go check it out. It&#8217;s free, but you&#8217;ll need to sign up for a <a href="http://espn.go.com/travel/passport/">free ESPN Passport login</a> to get the most out of it (Facebook and Twitter logins add even more).</p>
<p><a href="http://itunes.apple.com/us/app/espn-passport/id382744201?mt=8"><img style="display:block; margin-left:auto; margin-right:auto;" src="http://corporationunknown.com/blog/wp-content/uploads/2011/04/passport.png" alt="Passport" border="0" width="183" height="182" /></a></p>
<p>(By the way, have you tried RogueSheep&#8217;s latest app, <a href="http://www.roguesheep.com/easyalarms.html">Easy Alarms</a>? I played no part in it, but it rocks all the same.)</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2011/04/24/it-lives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You Got Your License In My Keychain!</title>
		<link>http://corporationunknown.com/blog/2011/04/13/you-got-your-license-in-my-keychain/</link>
		<comments>http://corporationunknown.com/blog/2011/04/13/you-got-your-license-in-my-keychain/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 16:18:21 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=278</guid>
		<description><![CDATA[The One In Which Paul Talks Out His Hat (metaphorically, since he and hats don&#8217;t get along). During an entertaining aside in Andy Ihnatko&#8216;s keynote at this weekend&#8217;s Voices That Matter conference, I was reminded of a thought I&#8217;d had a while ago: Why don&#8217;t Mac desktop applications store their license info in the Keychain? [...]]]></description>
			<content:encoded><![CDATA[<p><em>The One In Which Paul Talks Out His Hat (metaphorically, since he and hats don&#8217;t get along).</em></p>
<p>During an entertaining aside in <a href="http://ihnatko.com/">Andy Ihnatko</a>&#8216;s keynote at this weekend&#8217;s <a href="http://iphonespring2011.crowdvine.com/">Voices That Matter conference</a>, I was reminded of a thought I&#8217;d had a while ago: Why don&#8217;t Mac desktop applications store their license info in the <a href="http://developer.apple.com/library/ios/#documentation/Security/Conceptual/keychainServConcepts/01introduction/introduction.html">Keychain</a>?</p>
<p>Complaining about restoring license keys should be just as trite of a humor topic as little bags of peanuts on flights, but it still holds true. Go to restore a machine, or move to a new one with a clean install, and you can write off at least an afternoon launching and entering at least two text fields per application.</p>
<p>Maybe I&#8217;m the only one who feels quite comfortable with syncing to MobileMe&#8211;I actually consider it <em>the</em> feature that keeps me coming back. (I do know there are people who have frustrating issues, and I truly feel for them, but I continue to believe they are in the minority.) Given that setup, here&#8217;s how I&#8217;d see setting up a new laptop:</p>
<ol>
<li>Configure my MobileMe account and sync down the data, setting up my Mail accounts, Address Book and Calendar&#8211;and Keychain.</li>
<li>Launch a new copy of my licensed application.</li>
<li>There is no Step Three. Go on your merry way.</li>
</ol>
<p>I&#8217;m not expert enough to suggest that it would improve security of your key, but it sure would discourage casual tweaking more than the plist or hidden file schemes you&#8217;d need to develop on your own. Also, separation of license key from a preferences file (hopefully developers are already doing this) allows a user to delete the preferences and start fresh without having to worry about relicensing.</p>
<p>I understand that Keychain development can be convoluted, but is that reason enough to not make the user&#8217;s life a little bit easier and your support burden of finding a lost license a little less frequent?</p>
<p>As I said at the top, I realize I&#8217;m talking out of my&#8230;hat here. I don&#8217;t have experience doing this (yet), so I am interested in hearing reasoned arguments. Until and unless this is proven untenable, simply consider it a feature request for your next release.</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2011/04/13/you-got-your-license-in-my-keychain/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>iPad and the Digital Hub, Revisited</title>
		<link>http://corporationunknown.com/blog/2011/03/10/ipad-and-the-digital-hub-revisited/</link>
		<comments>http://corporationunknown.com/blog/2011/03/10/ipad-and-the-digital-hub-revisited/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 14:33:02 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=274</guid>
		<description><![CDATA[Apple released iOS 4.3 yesterday, and it looks like iTunes Home Sharing provides almost everything I had wished for in my original post. There seem to be some quirks (all videos and podcasts are marked as unplayed on the device) and other behaviors I&#8217;d like changed (watching/listening to a podcast on the device doesn&#8217;t report [...]]]></description>
			<content:encoded><![CDATA[<p>Apple released iOS 4.3 yesterday, and it looks like <a href="http://www.appleinsider.com/articles/11/03/03/inside_ios_4_3_mobile_streaming_with_itunes_home_sharing.html">iTunes Home Sharing</a> provides almost everything I had wished for in <a href="http://corporationunknown.com/blog/2010/07/08/ipad-and-the-digital-hub/">my original post</a>.</p>
<p>There seem to be some quirks (all videos and podcasts are marked as unplayed on the device) and other behaviors I&#8217;d like changed (watching/listening to a podcast on the device doesn&#8217;t report that to the shared library). These niggles are really just small issues compared to the big advance of having access to my full library.</p>
<p>Thank you, iOS team!</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2011/03/10/ipad-and-the-digital-hub-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Year in Review 2010</title>
		<link>http://corporationunknown.com/blog/2011/01/11/year-in-review-2010/</link>
		<comments>http://corporationunknown.com/blog/2011/01/11/year-in-review-2010/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 16:19:29 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=261</guid>
		<description><![CDATA[It&#8217;s still the first half of January, so I&#8217;m in the grace period for a &#8220;Year in Review&#8221; post. 2010 was one heck of a slingshot year for me and Corporation Unknown. I started the year unemployed and thin on contract work, and finished it with Corporation Unknown&#8217;s highest revenue in its 3-year history and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s still the first half of January, so I&#8217;m in the grace period for a &#8220;Year in Review&#8221; post. </p>
<p>2010 was one heck of a slingshot year for me and Corporation Unknown. I started the year unemployed and thin on contract work, and finished it with Corporation Unknown&#8217;s highest revenue in its 3-year history and a job offer I can&#8217;t refuse.</p>
<p><span id="more-261"></span><br />
<h1>Bankruptcy</h1>
<p>After starting out looking promising, 2009 was rough. The latter half was my first try at full-time independent contracting. I spent time working on project proposals where the client apparently went with someone willing to work for $25/hour; I did work on a decent project (iPhone client for the web site they were developing) that then went &#8220;on hold&#8221; once the company I was subcontracting for realized that <em>their</em> client was behind on payments to the tune of six digits. (They paid me in full, I don&#8217;t know if they ever got the same.)</p>
<p>At the beginning of 2010, my wife and I filed for personal bankruptcy. This isn&#8217;t something I&#8217;m proud of, but I refuse to hide it as a personal shame. I debated even mentioning this here, except for two points I hope might be able to help others approaching a similar situation:</p>
<ol>
<li>Start looking into bankruptcy <em>before</em> dipping into retirement savings. Most likely, those funds are protected from the proceedings and you won&#8217;t have to start over.</li>
<li>The idea of paying a lawyer $3k to file for bankruptcy seems <em>wrong</em>, doesn&#8217;t it? It was completely worth it. Under our attorney&#8217;s advice, we knew exactly what to expect with no surprises. Sometimes when trying to restart parts of your life, it&#8217;s refreshing to just chuck it all and walk away, consequences be damned&#8211;this is not one of those times.</li>
</ol>
<h1>Contracting</h1>
<p>Independent contracting in 2010 was hot and cold. More accurately, cold then hot, and feast or famine. I&#8217;d go without prospects for a while, then have a few come all at once that I actually had to choose from. Managing a client pipeline is not easy as a solo contractor.</p>
<p>In the spring, I had the opportunity to work with local friends <a href="http://blackpixel.com/">Black Pixel</a> on a small part of a fairly large project for iPad&#8211;before its release. It&#8217;s hard to believe the iPad hasn&#8217;t been out a full year yet; recalling having to code for iPad without a test device feels like reminiscing about the punchcard days.</p>
<p>I had a good time working on that project, even though it was all too brief. The team was wonderful, and even though it feels unfair, I have to single out the experience of working with Chris Clark. It was the first time I&#8217;d had the opportunity to work on an iOS project with a dedicated designer&#8211;one who listens, takes feedback, and respectfully tells you you&#8217;re either wrong, or he just prefers his design anyway&#8211;and I loved that.</p>
<p>At that time, I was also working on a project with a existing client. They had an iPhone app that I had cleaned up somewhat, and the announcement of iPad seemed an ideal fit for their product. Unfortunately, in the early days of the iPad, I still needed a lot of experimenting to get a feel for what &#8220;worked&#8221; and what didn&#8217;t. In their desire to get in to the field as quick as possible, they felt that the project was taking too long and ended up opting out of the contract.</p>
<p>Then in May, I had the opportunity to do some subcontracting work for fellow locals <a href="http://www.roguesheep.com/">RogueSheep</a>. The project was for a component of an iPad app that, once I got past the &#8220;why would you want to do that?&#8221; aspect, provided some interesting challenges in designing custom controls and animations, and I loved that.</p>
<p>RogueSheep is another great team, and another great designer in Brad Ellis (even if he has since moved on to <a href="https://squareup.com/">Square</a>). Brad has the same positive qualities as Chris, with the addition of slightly crazier ideas that push you to create something you wouldn&#8217;t have imagined on your own. </p>
<p>Thankfully, the Sheep have continued to have a project pipeline for me to work on: I wrote another bit of code that I&#8217;m not even sure has made it onto the store yet for the same client; I wrote some UI code for RogueSheep&#8217;s own <a href="http://touchup.roguesheep.com/">TouchUp for iPad</a> application as they were readying it for release, and I&#8217;m in the process of finishing off another pretty major iPhone project for another of their clients. They even let me touch their Apple Design Award.</p>
<p>Thanks in large part to RogueSheep, in its first full year of full-time effort, Corporation Unknown has recorded its highest annual revenue:</p>
<p><img style="display:block; margin-left:auto; margin-right:auto;" src="http://corporationunknown.com/blog/wp-content/uploads/2011/01/CU-Revenue.png" alt="CU Revenue.png" border="0" width="394" height="215" /></p>
<h1>Onward</h1>
<p>This year already has some promising challenges ahead:</p>
<ol>
<li>Beginning in March, I will be teaching &#8220;Developing with the iPhone SDK,&#8221; the middle course of the iPhone and Cocoa Development certification from the University of Washington&#8217;s Professional and Continuing Education.</li>
<li>I have accepted an offer to return to Black Pixel full-time beginning in February. It&#8217;s been tough feeling like I&#8217;m choosing between two great companies and teams, but I am really excited to be rejoining Black Pixel&#8217;s now-expanded team and continuing to kick some iOS butt.</li>
<li>On top of all that, our second child is due at the end of July.</li>
</ol>
<p>2011 is going to be a busy year!</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2011/01/11/year-in-review-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bughunting a Bashful Table View</title>
		<link>http://corporationunknown.com/blog/2010/12/14/bughunting-a-bashful-table-view/</link>
		<comments>http://corporationunknown.com/blog/2010/12/14/bughunting-a-bashful-table-view/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 15:46:15 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=250</guid>
		<description><![CDATA[I ran down a strange bug yesterday that I thought I would recount in the hopes of saving someone else the half day of frustration. I was going along, minding my own business, implementing a typical -tableView:didSelectRowAtIndexPath: delegate method to create a view controller, push it onto the navigation stack, and then&#8230;nothing. The view didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I ran down a strange bug yesterday that I thought I would recount in the hopes of saving someone else the half day of frustration.</p>
<p>I was going along, minding my own business, implementing a typical <code>-tableView:didSelectRowAtIndexPath:</code> delegate method to create a view controller, push it onto the navigation stack, and then&#8230;nothing. The view didn&#8217;t appear, and the app interface became unresponsive. Numerous pauses in the debugger showed what would appear to be normal stacks in the running of the app&#8211;no infinite recursion going on, thankfully.</p>
<p>The view was actually in a strange nesting of <code>UITableViewControllers</code>, <code>UINavigationControllers</code> and <code>UITabBarControllers</code>, so I reworked that to the bare bones of a <code>UITableViewController</code> pushing a freshly made <code>UITableViewController</code> onto its navigationController. I verified that it was being initialized properly, and that I had a valid navigationController to push onto (and other view controllers did push with the same navigationController). Still no change.</p>
<p><span id="more-250"></span>Then I added breakpoints to every <code>UITableViewDelegate</code> and <code>DataSource</code> method I&#8217;d implemented, even the trivial hardcoded ones (&#8220;<code>return 3;</code>&#8221; for <code>-numberOfSectionsInTableView:</code>) at first to ensure they were being called (they were). Thus began the tedium of following the chain of 4 or 5 calls per table row until I found the offending code.</p>
<p>This new table view is composed of a number of sections each composed of only one cell. The cells are designed in Interface Builder as top-level objects, and are IBOutlets of the File&#8217;s Owner View Controller. Technically, it&#8217;s one big scroll view but I&#8217;m using this design to provide some layout flexibility if the client wants to reorganize sections, and I thought it would be cool to have the dynamic scrolling of section headers, too.</p>
<p>Since I want the IB objects to define the layout, I determine the height of each row based on the view&#8217;s frame: </p>
<pre>
	height = CGRectGetHeight( self.playerStatsCell.frame );
</pre>
<p>The value for height of this cell (the last on the list&#8211;the others were fine) was a &#8220;whopping&#8221; 6.30104785e-38. What was going on here?!</p>
<p>Well, <code>self.playerStatsCell</code> wasn&#8217;t actually connected yet because I was testing (<em>trying</em> to test) one row/section at a time. Calling the frame method on a nil object seems like a normal thing to do in messaging-nil-happy Objective-C. But it&#8217;s not. The call is effectively short-circuited, and the temporary <code>CGRect</code> variable the return value was supposed to fill is left uninitialized, which is the bizarre height value returned by <code>CGRectGetHeight</code>.</p>
<p>This call is equivalent to:</p>
<pre>
	CGRect frame; // uninitialized struct
	frame = self.playerStatsCell.frame;
	height = CGRectGetHeight( frame );
</pre>
<p>A simple change to the following would fix it:</p>
<pre>
	CGRect frame = CGRectZero; // initialized struct
	frame = self.playerStatsCell.frame;
	height = CGRectGetHeight( frame );
</pre>
<p>(In my case, I resolved it by connecting a temporary cell object in IB.)</p>
<p>What did I learn from this?</p>
<ol>
<li>Messaging to nil is normally fine, but definitely not for struct-returning methods.</li>
<li>Returning a cell height that is very, very tiny from <code>-tableView:heightForRowAtIndexPath:</code> results in &#8220;strange behavior.&#8221;</li>
</ol>
<p>I still don&#8217;t know exactly what the app was doing while it <em>wasn&#8217;t</em> displaying the new table view, but now I know what to quickly look for when I can&#8217;t push a <code>UITableViewController</code> in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2010/12/14/bughunting-a-bashful-table-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sudden Termination</title>
		<link>http://corporationunknown.com/blog/2010/10/30/sudden-termination/</link>
		<comments>http://corporationunknown.com/blog/2010/10/30/sudden-termination/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 22:19:42 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://corporationunknown.com/blog/?p=247</guid>
		<description><![CDATA[Today, Tim Bray commented about Android applications needing to frequently save their restore state and be ready and able to gracefully terminate without notice. (This behavior also applies to iOS apps, of which I have much more experience than Android.) At some point, after I’d explained a few times why you have to write software [...]]]></description>
			<content:encoded><![CDATA[<p>Today, <a href="http://www.tbray.org/ongoing/When/201x/2010/10/30/Three-Android-Software-Rules">Tim Bray commented</a> about Android applications needing to frequently save their restore state and be ready and able to gracefully terminate without notice. (This behavior also applies to iOS apps, of which I have much more experience than Android.)</p>
<blockquote><p>At some point, after I’d explained a few times why you have to write software this way on Android, I started wondering why all software, without exception, isn’t written this way by default.
</p></blockquote>
<p>As of 10.6, Apple added <code>enableSuddenTermination</code> and <code>disableSuddenTermination</code> calls to the <a href="http://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_6.html#//apple_ref/doc/uid/TP40008898-SW22">NSProcessInfo API</a> to allow you to implement similar behavior on the desktop. At its most simplistic description, you can inform the system your application doesn&#8217;t need to have its memory paged back in just to destroy it all&#8211;just kill the process and you will be sure it behaves properly on relaunch.</p>
<p>I encourage all fellow iOS developers who have already acquired a &#8220;sudden termination&#8221; design style to make note of this when developing a desktop Cocoa application; I also encourage desktop Cocoa developers to start thinking about how they would design with this paradigm, as it will be one more portable technique when and if you decide to go mobile.</p>
<p>(<a href="http://developer.apple.com/library/mac/#technotes/CachingPurgeableMemory/Introduction/Introduction.html">NSCache and Purgeable Memory</a> is another new-to-10.6 mechanism I consider similar to iOS&#8217; <code>didReceiveMemoryWarning</code>, only giving the OS permission to purge memory instead of it requesting you clean up.)</p>
]]></content:encoded>
			<wfw:commentRss>http://corporationunknown.com/blog/2010/10/30/sudden-termination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 5/12 queries in 0.282 seconds using disk: basic

Served from: corporationunknown.com @ 2012-05-18 11:07:48 -->
