<?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>OmegaDelta &#187; dev</title>
	<atom:link href="http://omegadelta.net/tag/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://omegadelta.net</link>
	<description>It&#039;s good</description>
	<lastBuildDate>Fri, 03 Feb 2012 00:03:00 +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>[[UIDevice currentDevice] uniqueIdentifier] Substitute</title>
		<link>http://omegadelta.net/2012/02/02/uidevice-currentdevice-uniqueidentifier-substitute/</link>
		<comments>http://omegadelta.net/2012/02/02/uidevice-currentdevice-uniqueidentifier-substitute/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 13:42:33 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[deprecation]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3408</guid>
		<description><![CDATA[Identifying devices uniquely is handy. Apple deprecated their uniqueIdentifier property, with the severe warning &#8220;Do not use the uniqueIdentifier property&#8221;, so it&#8217;s time to migrate before they remove it altogether or start rejecting apps *sigh*. With that in mind, I created a replacement method for UIDevice: UDID. It uses the device&#8217;s MAC address to generate [...]]]></description>
			<content:encoded><![CDATA[<p>Identifying devices uniquely is handy. Apple deprecated their <code>uniqueIdentifier</code> property, with the severe warning &#8220;Do not use the uniqueIdentifier property&#8221;, so it&#8217;s time to migrate before they remove it altogether or start rejecting apps <em>*sigh*</em>.</p>
<p>With that in mind, I created a replacement method for UIDevice: <code>UDID</code>.  It uses the device&#8217;s MAC address to generate a unique ID that is the same length as the old UDIDs. I was inspired by some other people&#8217;s solutions, but rolled my own implementation which I feel is neater, and more compatible (as it generates similar 40char UDIDs). <a href="https://github.com/WilliamDenniss/UIDevice-UDID">You can fork it on github</a>.</p>
<p>It&#8217;s not a drop-in replacement, for fear of monkey patching over an existing method. Just do a find &#038; replace with: <code>[[UIDevice currentDevice] UDID]</code>.</p>
<p>Of course: consider if device identifiers are right for you. To identify a specific install of your app (which can be migrated from one iPhone another due to loss/upgrading), generating a UUID and saving that as a NSUserDefault would work best (since it will transfer with the app data).</p>
<p>License: public domain.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2012/02/02/uidevice-currentdevice-uniqueidentifier-substitute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turbocharging git on Mac OS X</title>
		<link>http://omegadelta.net/2012/01/23/turbocharging-git-on-mac-os-x/</link>
		<comments>http://omegadelta.net/2012/01/23/turbocharging-git-on-mac-os-x/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 08:11:51 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3372</guid>
		<description><![CDATA[This weekend I discovered two awesome graphical tools to improve my git experience on Mac OS X: The most awesome is KDiff3 (search for &#8216;Apple Mac OSX binary&#8217; on that page for the Mac binary). This is a three-way merge tool with an editing panel below. Seriously where has this been all my life? Amazing. [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I discovered two awesome graphical tools to improve my git experience on Mac OS X:</p>
<p>The most awesome is <a href="http://kdiff3.sourceforge.net/">KDiff3</a> (search for &#8216;Apple Mac OSX binary&#8217; on that page for the Mac binary). This is a three-way merge tool with an editing panel below. Seriously where has this been all my life? Amazing.</p>
<p>Download it, and install – make sure it&#8217;s in your system PATH. Then simply run <code>git config --global merge.tool kdiff3</code> to set it as your default merge tool.  Now every time you get a conflict, your <code>git mergetool</code> command will actually be rather helpful!  Basically you are shown the base revision (that both branches split from) in the middle, one branch either side, and an editor below allowing you to pick which side you want and/or edit the file directly.</p>
<p>The second tool I (re)discovered was <a href="http://www.sourcetreeapp.com/">SourceTree</a> (<a href="http://itunes.apple.com/au/app/sourcetree-git-hg/id411678673?mt=12">Mac App Store DL Link</a>).  It is a Mac GUI client for git. I&#8217;m pretty comfortable with the command line, but what I love about this tool is it allows me to review my changes before I commit them (either staged or unstaged), discard hunks I don&#8217;t want, and of course open the file in question for editing.  Very convenient. <code>git diff</code> is nice and all, but I love having that handy &#8216;discard hunk&#8217; button in SourceTree so I can skip my silly changes.  For me this is the most useful feature, though no doubt there are others. Oh and it&#8217;s free (it&#8217;s a bit confusing, as there is a &#8220;trial&#8221; period, but after the trial you simply register for free, and are given a license).</p>
<p><span id="more-3372"></span></p>
<p>Refs:<br />
1. <a href="http://progit.org/book/ch7-1.html">Some useful git config tips</a><br />
2. <a href="http://stackoverflow.com/questions/187064/graphical-diff-for-mac-os-x"> Graphical Diff Tools for Mac OS X</a><br />
3. <a href="http://stackoverflow.com/questions/426026/git-on-windows-how-do-you-set-up-a-mergetool">Setting up mergetool on windows</a></p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2012/01/23/turbocharging-git-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating data in a Rails migration</title>
		<link>http://omegadelta.net/2012/01/11/migrating-data-in-a-rails-migration/</link>
		<comments>http://omegadelta.net/2012/01/11/migrating-data-in-a-rails-migration/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 02:50:52 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3336</guid>
		<description><![CDATA[Turns out it&#8217;s easy to whack any old piece of code into the migration for migrating your data, for example these work well for some arbitrary SQL statements (I used UPDATE ones&#8230;) ActiveRecord::Base.connection.select_one('SELECT COUNT(*) FROM mytable') ActiveRecord::Base.connection.execute('SELECT * FROM mytable') Thanks revgeorge.]]></description>
			<content:encoded><![CDATA[<p>Turns out it&#8217;s easy to whack any old piece of code into the migration for migrating your data, for example these work well for some arbitrary SQL statements (I used UPDATE ones&#8230;)</p>
<pre class="brush:sql">
ActiveRecord::Base.connection.select_one('SELECT COUNT(*) FROM mytable')
ActiveRecord::Base.connection.execute('SELECT * FROM mytable')
</pre>
<p>Thanks <a href="http://ask.metafilter.com/28980/How-do-I-write-arbitrary-SQL-queries-in-Ruby-on-Rails#456303">revgeorge</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2012/01/11/migrating-data-in-a-rails-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AppleIDs and multiple iOS developer accounts</title>
		<link>http://omegadelta.net/2011/12/19/appleids-and-multiple-ios-developer-accounts/</link>
		<comments>http://omegadelta.net/2011/12/19/appleids-and-multiple-ios-developer-accounts/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 08:23:18 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3276</guid>
		<description><![CDATA[&#8220;In the iOS Development Ecosystem the people are represented by two separate, yet equally important groups. The iOS Developer Users who create apps and the iTunesConnect Users who upload the apps. These are their stories.&#8221; An iOS team is actually in two parts: the iOS Developer Team, accessed via the Member Center, and a completely [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;In the iOS Development Ecosystem the people are represented by two separate, yet equally important groups. The iOS Developer Users who create apps and the iTunesConnect Users who upload the apps. These are their stories.&#8221;</p>
<p>An iOS team is actually in two parts: the iOS Developer Team, accessed via the Member Center, and a completely separate iTunes Connect team.</p>
<p>It turns out that the one AppleID can belong to multiple iOS developer teams, and Apple asks you when you login to the member center which team you want to use.  However iTunes Connect has no such feature, and each AppleID can only belong to one iTunes Connect &#8220;team&#8221;.</p>
<p>So you can re-use AppleIDs for developer accounts, but not itunes connect accounts. It&#8217;s up to you I guess if you want a totally separate AppleID for each team, or just each iTunes connect account.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2011/12/19/appleids-and-multiple-ios-developer-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>monit</title>
		<link>http://omegadelta.net/2011/12/18/monit/</link>
		<comments>http://omegadelta.net/2011/12/18/monit/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 01:49:33 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3271</guid>
		<description><![CDATA[Monit for linux is a great way to make sure Apache is running. I set it up with the help of this fantastic tutorial. My steps after the break. Install yum install monit Configure on boot /sbin/service chkconfig --levels 235 monit on Create the config file vi /etc/monit.d/monitrc With something like: set daemon 30 set [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mmonit.com/monit/">Monit for linux</a> is a great way to make sure Apache is running.</p>
<p>I set it up with the help of this <a href="http://www.dullnicker.com/dnb/?p=83">fantastic tutorial</a>. My steps after the break.</p>
<p><span id="more-3271"></span></p>
<p>Install</p>
<pre>
yum install monit
</pre>
<p>Configure on boot</p>
<pre>
/sbin/service chkconfig --levels 235 monit on
</pre>
<p>Create the config file</p>
<pre>
vi /etc/monit.d/monitrc
</pre>
<p>With something like:</p>
<pre>
set daemon 30
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: monit@www.example.com }
set alert you@example.com

check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/sshd start"
stop program "/etc/init.d/sshd stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout

check process apache with pidfile /var/run/httpd.pid
group www
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host www.example.com port 80 protocol http
and request "/monit/token" then restart
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 500 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout
</pre>
<p><ocde>set daemon</code> is used to specify the <a href="http://mmonit.com/monit/documentation/monit.html#daemon_mode">number of seconds between each check</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2011/12/18/monit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSDateFormatter format specifiers</title>
		<link>http://omegadelta.net/2011/12/13/nsdateformatter-format-specifiers/</link>
		<comments>http://omegadelta.net/2011/12/13/nsdateformatter-format-specifiers/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 12:02:37 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3265</guid>
		<description><![CDATA[Ever wanted the list of format specifiers? As per the docs, it is here. Anything in single quotes is put through as-is.]]></description>
			<content:encoded><![CDATA[<p>Ever wanted the list of format specifiers?</p>
<p>As per the <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html">docs</a>, it is <a href="http://unicode.org/reports/tr35/tr35-10.html#Date_Format_Patterns">here</a>.</p>
<p>Anything in single quotes is put through as-is.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2011/12/13/nsdateformatter-format-specifiers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Market Resources</title>
		<link>http://omegadelta.net/2011/12/13/android-market-resources/</link>
		<comments>http://omegadelta.net/2011/12/13/android-market-resources/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 09:23:37 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[dev]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3260</guid>
		<description><![CDATA[Confused about what each of the images do and how they&#8217;re cropped? Look no further than this awesome test app! Market link here. Some high quality phone image marketing resources. I like this one.]]></description>
			<content:encoded><![CDATA[<p>Confused about what each of the images do and how they&#8217;re cropped?</p>
<p>Look no further than this <a href="http://xayin.com/thisisatest.html">awesome test app</a>! Market link <a href="https://market.android.com/details?id=com.xayin.android.thisisatest">here</a>.</p>
<p>Some <a href="http://speckyboy.com/2010/02/17/40-detailed-and-high-quality-mobile-phone-psd-source-files/">high</a> <a href="http://www.webanddesigners.com/20-free-phone-and-ipad-gui-psd-and-vector-templates-for-web-designers/">quality</a> <a href="http://www.designscollage.com/2011/04/65-outstanding-mobile-phones-gui-design-psd-packs/">phone</a> image marketing resources. I like <a href="http://bharathp666.deviantart.com/art/Google-nexus-one-V2-Templates-150971548">this one</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2011/12/13/android-market-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Posting to Rails with AJAX</title>
		<link>http://omegadelta.net/2011/12/05/posting-to-rails-with-ajax/</link>
		<comments>http://omegadelta.net/2011/12/05/posting-to-rails-with-ajax/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 06:16:35 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3217</guid>
		<description><![CDATA[Don&#8217;t forget your csrf token! How to do it in Javascript. The token itself can be retrieved in Rails with: session[:_csrf_token]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t forget your csrf token!</p>
<p><a href="http://stackoverflow.com/questions/5126721/rails-not-reloading-session-on-ajax-post">How to do it in Javascript.</a></p>
<p>The token itself can be retrieved in Rails with: <code>session[:_csrf_token]</code></p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2011/12/05/posting-to-rails-with-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When symbolicatecrash Fails (and it often does)</title>
		<link>http://omegadelta.net/2011/11/17/when-symbolicatecrash-fails-and-it-often-does/</link>
		<comments>http://omegadelta.net/2011/11/17/when-symbolicatecrash-fails-and-it-often-does/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 03:40:59 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3207</guid>
		<description><![CDATA[This problem has plagued me for almost three years now. It seems sometimes symbolicatecrash works, sometimes it doesn&#8217;t. I have all my dSYM files (I even use a build script that archives them all automatically), and spotlight can find them from the UDID, but to no avail. The solution is atos. I copied the dSYM [...]]]></description>
			<content:encoded><![CDATA[<p>This problem has plagued me for almost three years now. It seems sometimes symbolicatecrash works, sometimes it doesn&#8217;t.</p>
<p>I have all my dSYM files (I even use a <a href="http://omegadelta.net/2009/11/13/dsym-archive-script/">build script that archives them all automatically</a>), and spotlight can find them from the UDID, but to no avail.</p>
<p>The solution is <code>atos</code>.</p>
<p>I copied the dSYM file (actually a folder) to the desktop, and run this command &#038; you will get the file &#038; line of code. Repeat for each symbol in the crash that you need (generally you only need one or two key ones&#8230;) </p>
<pre class="brush: bash;">
$ atos -arch armv7 -o ~/Path/to/Your.app.dSYM/Contents/Resources/DWARF/AppName 0x000cefd8
 -[SomeClass someMethod] (in GeoLog) (AppName.m:242)
</pre>
<p>Thanks to <a href="http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports/4954949#4954949">NaveenShan</a> for this tip.</p>
<p>Incidentally, If someone writes a Mac OS X app that can reliably symbolicate crashes, each time, every time, and doesn&#8217;t break on every new version of the SDK/OS – I will pay upwards of $50.</p>
<p>I wish things would just work, and I wouldn&#8217;t have to waste my precious dev time stuffing around with this crap.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2011/11/17/when-symbolicatecrash-fails-and-it-often-does/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oh My God They Killed parentViewController</title>
		<link>http://omegadelta.net/2011/11/04/oh-my-god-they-killed-parentviewcontroller/</link>
		<comments>http://omegadelta.net/2011/11/04/oh-my-god-they-killed-parentviewcontroller/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 12:14:40 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[annoyance]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://omegadelta.net/?p=3154</guid>
		<description><![CDATA[Pre iOS 5, &#8216;parentViewController&#8217; would return the view-stack&#8217;s parent view controller, or the controller which presented that controller when called on a modal view controller. This was the intended, documented functionality of the method, not some mistake. iOS 5 changes this by splitting out the latter functionality to &#8216;presentingViewController&#8217;. Unfortunately, rather than creating 2 new [...]]]></description>
			<content:encoded><![CDATA[<p>Pre iOS 5, &#8216;parentViewController&#8217; would return the view-stack&#8217;s parent view controller, or the controller which presented that controller when called on a modal view controller. This was the intended, documented functionality of the method, not some mistake.</p>
<p>iOS 5 changes this by splitting out the latter functionality to &#8216;presentingViewController&#8217;. Unfortunately, rather than creating 2 new methods with new functionality, they simply changed the old one and created the new one. So for anyone like me who missed this particular change (it&#8217;s not even in the API diffs as it&#8217;s not changed, or removed), [self parentViewController] starts returning nil, your code continus to run, but will probably hang if when you expect to have dismissed the view controller.</p>
<p>What terrible design. I think it would have been better to deprecated the old function &amp; split it into two new ones. Or at least provide some warnings to the change. If Objective-C actually crashed on nil values like java, again this would be easy to spot &amp; change – but hang bugs are particularly nasty to try and solve.</p>
<p>Anyway, here are my testing results of [self parentViewController] where self is a controller that was presented as modal:</p>
<p>XCode 4.1 &amp; SDK 4.3: iOS 5: presentingViewController, iOS 4.x: presentingViewController<br />
XCode 4.2 &amp; SDK 5.0: iOS 5: nil, iOS 4.x: presentingViewController</p>
<p>As you can see, when iOS5 runs the older SDK it doesn&#8217;t break (because that would break everyone&#8217;s code), and iOS4 running with code from the new SDK doesn&#8217;t break either. Just SDK &amp; iOS 5 together.</p>
<p>Fixing this if you only support iOS 5 is simple. Replace every instance of [self parentViewController] where you want the model view controllers parent to [self presentingViewController].</p>
<p>Most people need to support iOS 4. This is a bit of a pain because you can&#8217;t just call &#8216;presentingViewController&#8217; without it crashing (due to this method not existing on iOS4). Here&#8217;s my #define to get the old behaviour back:</p>
<pre class="brush: objc">#define self_parentViewController (([self parentViewController] != nil || ![self respondsToSelector:@selector(presentingViewController)]) ? [self parentViewController] : [self presentingViewController])</pre>
<p>In english, this means: if the parentViewController is not nil, or the presentingViewController method doesn&#8217;t exist yet (in the case of &lt; iOS 5.0), return the result of presentingViewController. Else return the result of presentingViewController.</p>
<p>EDIT: if you need to call the old parentViewController on something other than self, try my <a href="http://omegadelta.net/2011/11/04/oh-my-god-they-killed-parentviewcontroller/#comment-35034">revised #define</a>.</p>
<p>NB. just like before – this *may* not return the presenting view controller, if self has it&#8217;s own parentViewController that isn&#8217;t the one which presented it. But this <em>is equal to the old SDK behaviour</em>, so I don&#8217;t think it will introduce bugs.</p>
<p>Everywhere in your code, replace <code>[self parentViewController]</code> with <code>self_parentViewController</code> (no square brackets).</p>
<p>#defines are normally pretty evil but in this case, until you drop 4.0 support I actually feel it&#8217;s cleaner. Now you could do <code>[self parentViewController] || [self presentingViewController]</code>, and this will work in many cases, that is <em>until parentViewController returns nil</em> on iOS 4, when your app will crash due to the unrecognised &#8216;presentingViewController&#8217; selector. Safter to use my #define for full backwards compatibility.</p>
<p><span id="more-3154"></span></p>
<p>Pre iOS 5.0 docs:</p>
<blockquote><p>parentViewController<br />
The parent of the current view controller. (read-only)</p>
<p>@property(nonatomic, readonly) UIViewController *parentViewController<br />
Discussion<br />
Parent view controllers are relevant in navigation, tab bar, and modal view controller hierarchies. In each of these hierarchies, the parent is the object responsible for displaying the current view controller. If you are using a view controller as a standalone object—that is, not as part of a view controller hierarchy—the value in this property is nil.</p></blockquote>
<p>Now it states (emphasis added)</p>
<blockquote><p>parentViewController<br />
The parent of the current view controller. (read-only)</p>
<p>@property(nonatomic, readonly) UIViewController *parentViewController<br />
Discussion<br />
Parent view controllers are relevant in navigation, tab bar, and modal view controller hierarchies. In each of these hierarchies, the parent is the object responsible for displaying the current view controller. If you are using a view controller as a standalone object—that is, not as part of a view controller hierarchy—the value in this property is nil.</p>
<p><strong>Prior to iOS 5.0, if a view did not have a parent view controller and was being presented modally, the view controller that was presenting it would be returned. This is no longer the case. You can get the presenting view controller using the presentingViewController property.</strong></p></blockquote>
<p>Yet it still says it&#8217;s relevant in the &#8216;modal view controller hierarchies&#8217;, is it?</p>
<p>Also I love that modalViewController still says &#8216;see also: parentViewController&#8217;, there isn&#8217;t really a need for this now.</p>
<p>modalViewController<br />
The controller for the active modal view—that is, the view that is temporarily displayed on top of the view managed by the receiver. (read-only)</p>
<blockquote><p>@property(nonatomic, readonly) UIViewController *modalViewController<br />
Discussion<br />
Typically, a modal view is used to present an edit page or additional details of a model object. The modal view is optionally displayed using a vertical sheet transition.</p>
<p>Availability<br />
Available in iOS 2.0 and later.<br />
See Also<br />
@property parentViewController<br />
Declared In<br />
UIViewController.h</p></blockquote>
<p>Here&#8217;s the kicker in the docs. If you search for UIViewController and you have SDK 4.3 and 5.0 docs installed (common when you upgrade), you get multiple hits. If you pick the one that is the 5.0 sdk, then find the link to &#8216;parentViewController&#8217;. Clicking that link will open that method, but rather than scrolling down the page it will show it in the 4.3 docs! Without this warning. This makes this communication issue just that little bit worse.</p>
]]></content:encoded>
			<wfw:commentRss>http://omegadelta.net/2011/11/04/oh-my-god-they-killed-parentviewcontroller/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

