Auto Layout Slides and Video Available

On Thursday, January 10, I gave a talk at Seattle Xcoders about Auto Layout, explaining the benefits and workings of this new technology and sharing some tips learned from our adoption of auto layout.

I’ve uploaded the slides from my talk. I’ll upload the video once I’ve found a place to put it.

Update: Thanks to Paul Goracke of Seattle Xcoders, the video of my talk is now available as well. Unfortunately, for some reason the cursor got disassociated from the actual mouse position during the demos, and I don’t have any way to fix it. Sorry! (rdar://problem/13011198)

Seattle on a Sheet

It seems like @burritojustice‘s Islands of San Francisco map is flying around the ‘net. I just saw a retweet from Mike Jurewitz (aka @jury) that referenced it unsourced.

While his map is far more beautiful and informative, he credits me with inspiring him by producing a map I titled “Seattle on a Sheet.” I made this map in 2010, shortly after moving to Seattle, to help orient myself and flex my OmniGraffle skills. Unfortunately, all links to that file are now dead, as I’ve changed my online handle and web host since 2010.

Seeing that tweet spurred me to go looking for the original Seattle on a Sheet map, and after a brief trawling through Time Machine backups of a computer I’ve long since wiped and given to my mom, I found the map I thought was lost!

Here it is: Seattle on a Sheet.

edit: And now available in poster form from Zazzle!

My Email to Developer Programs regarding mandatory Apple ID password change

Every three months I’m forced to change my Apple ID password. This means remembering to update every single iCloud-capable device I own (currently six and growing); if I don’t, my shared info like calendars gets out of sync and I, being the forgetful person I am, miss events and information.

On top of that, the Dev Programs login forms all have a ridiculous onpaste attribute set so you can’t paste the passwords into the form. This means that on iOS I have to swap between 1Password and Safari to enter my password to log in.

I’m fed up with this stupidity. I just sent Dev Programs this nice little email:

When attempting to log in to the Developer Forums this morning, I was greeted with the all-to-common demand that I change my Apple ID password yet again. I find this demand infuriating, because I use a piece of software called 1Password to generate truly pseudorandom passwords. Every time I am forced to update my password, I have to then go around to every Apple device I own and update that password in all my iCloud account settings. If I forget a device, my calendars silently fail to synchronize and I miss important events. This is unacceptable.

But one of the other things 1Password does is allow me to copy and paste my cryptographically-secure passwords from the 1Password app into form fields. This makes generating and applying new passwords less painful. Alas, someone has made the decision that Apple’s developer login pages should prohibit pasting into the password field. This decision is not only the antithesis of Apple’s product ethos of setting up something correctly once and not having to modify it again, but actually decreases the security of the system. It discourages me from generating truly random passwords–instead, I must generate shorter, pronounceable passwords so I can remember them as I retype them. On the desktop, the 1Password Safari extension can modify the contents of the password field directly, but on iOS I have no recourse except to memorize and retype the password into the form.

This scheme is beyond user-hostile. It betrays extreme incompetence in that it actively encourages users to decrease the security of the system by encouraging the use of less cryptographically-secure passwords.

Again, so my message is crystal clear: forcing users to change passwords DECREASES the security of the system. Prohibiting users from pasting passwords into the login form DECREASES the security of the system.

Somehow, nobody else at my company is required to change their password on a regular basis. I am only aware of a few other developers that suffer the same counterproductive requirement to actively participate in harming the security of the ADC program. Not only do I want this ludicrous restriction lifted from my Apple ID, I want it lifted for EVERY other member of the Developer program.


UPDATE: Apple replied pretty darned quickly:

Thank you for contacting Apple Developer Support regarding Password requirements and restrictions. I am unable to change the password requirements and restrictions for your Developer Account.

We appreciate that you have taken the time to send us your feedback. Please be assured that all of your comments have been forwarded to the appropriate Apple team.

WWDC of the Future

So WWDC 2012 was announced at early o’ clock and sold out in less than two hours. New restrictions on multiple purchases didn’t do anything to stave the ever-shortening window. As compensation for all the interested developers who won’t get to go to WWDC this year, Apple has promised to quickly post the session videos online (as they’ve done in the past few years).

Which leads me to ask: why is WWDC still worth attending? WWDC’s allure has always been the exclusive combination of three features: the sessions, the labs, and the social interaction with the worldwide Cocoa community. Now that the sessions can be gotten online mere days after the conference (and have lately been repeated locally during the Tech Talk series), and much of the community wasn’t even awake to purchase tickets, the only remaining feature of WWDC is the direct access to Apple engineers provided by the labs.

Maybe it’s time to think of a post-WWDC world. Or perhaps a world in which an event named WWDC still exists but bears no resemblance to the event we currently know.

Continue reading

Draft Proposal for Namespaces in Objective-C

Adding namespaces to Objective-C is a non-trivial problem. This proposal is a working draft; it may have bugs. (In particular, the definition of @namespace blocks and the @using directive is incomplete, but it’s analogous enough to other languages that the intent should be obvious.) This draft will certainly need updates; I welcome comments at optshiftk [at] optshiftk [dot] com.

UPDATE September 11th, 2012: You can now find this proposal on GitHub. Further development will occur there.

UPDATE April 18th, 2012: Fixed a problem with the FwkProto example. The @implementation directive was all sorts of screwy. Thanks to Greg Parker for catching it.

Continue reading

Slides Available from “iCloud: Lessons Learned” Talk at Seattle Xcoders

Last Thursday I gave a talk at Seattle Xcoders titled “iCloud: Lessons Learned.” I’m very grateful for the warm reception and the stunning turnout—there were over 40 attendees, many of whom asked some very good questions.

By request, I have uploaded my slides. Hopefully they will be useful. If anyone happened to take video of the talk, please contact me at kyle dot sluder at gmail dot com. Thanks again to Disney for hosting us and to Seattle Xcoders for inviting me to blather on about iCloud for just over an hour.

Race Condition when Moving NSDocuments to iCloud

Update: I just re-read a cocoa-dev post from last month in which Kevin Perry from Apple states the following:

I don’t see the nested uses of performSynchronousFileAccessUsingBlock: you mentioned in that code, but that’s not a problem anyway, since file access is recursive, as long as it happens synchronously within the outer-most file access block (a fact that admittedly may not be documented well anywhere).

That would certainly change things. Perhaps the reason that -relinquishPresentedItemToWriter: was deadlocking on me is because it calls -performActivityWithSynchronousWaiting:, not just -performSynchronousFileAccess? I’ll have to experiment.


Now that iCloud is out, I can finally talk about this in a public forum. Unfortunately, the cocoa-dev mailing list is down. But I really need to get this question out there, or at least written down, because it involves one of the most confusing new APIs in Lion: -[NSDocument performSynchronousFileAccess:] (or -performAsynchronousFileAccess: if you really hate your sanity).

Continue reading

NSWindowController and -[NSWindow isReleasedWhenClosed]

I noticed that the Resource Programming Guide has been updated for ARC, which prompted me to investigate something that has puzzled me for a long time: how does NSWindowController interact with NSWindow’s “convenience” method -isReleasedWhenClosed? It turns out that NSWindowController actually calls -setReleasedWhenClosed:NO on its window as part of -setWindow:. It doesn’t matter if NSWindowController loaded the window from nib, or if it was initialized with -initWithWindow: directly.

This makes memory management of NSWindowController-owned windows saner. And nowadays, with our multi-core multi-GHz machines packed with oodles of RAM, it’s worth spending the extra bytes to create an NSWindowController to manage your windows rather than rely on the arcane -isReleaedWhenClosed method (and its equally-outmoded companion, the “visible at launch” flag in Interface Builder).

I’d really prefer if the Window nib templates assumed File’s Owner was an NSWindowController and unchecked the “Release when closed” checkbox by default. NSWindowController’s cleanup behavior means you can leave the “Release when Closed” checkbox checked but still reopen a closed window, which is misleading and probably the source of my confusion in the first place. I’ve filed this request as rdar://10349276 (also viewable on OpenRadar).

Why I Complained About “Under God”

After the President finished his speech announcing the death of Osama bin Laden, I bitched on Twitter about his citation of the Pledge of Allegiance, including the Cold War-era addition of “under God.” And I got a small bit of blowback for it. Rather than continue the complaint in 140-character pieces, I figured I’d do better to write out my thoughts in full.
I complained that despite the Pledge of Allegiance, we “are not and never have been one nation under God.” But that wasn’t my real point. I should have been clearer that my issue was with the political cynicism it exposed, and how sharply it contrasted with the frank, businesslike presentation that preceded it.

Obama knew he was addressing not just the U.S., but the entire world, including countries we have invaded, have threatened to invade, or have otherwise pressured with the implied threat of invasion. Dressing up the stage with a “Mission Accomplished” banner would have been wildly inappropriate. Instead, the President treated his audience as adults, and addressed them with facts and a plain reading of the official White House position on the affair. He demonstrated the candor that drove me to vote for him, and I was grateful.

But the President has been gearing up for the reelection campaign, and it’s started to become apparent in his speechwriting. He knows that there’s a fringe minority of voters who believe he is a secret Kenyan Muslim. But there’s a much larger group of voters who simply will not vote for a President whose religious views they feel do not sufficiently resemble their own. These voters form a base of the Republican Party, but are by no means only Republican voters.

So he’s started to play up the hints towards his Christian identity. Whereas in the past he has stressed that our nation is made up of believers and nonbelievers, and even tonight emphasized that our last decade of military campaigns has not been a war on or of creed, he chose to end tonight’s speech with two references to God: one from the Pledge, and one from himself asking that “God bless America.”

The reason this language bothers me so much is because it is a concession to these voters. Yes, the President is a politician, and he has to end his speech somehow. But many of these voters believe that the opinions of atheists (or other non-Christians) should not be considered. My own parents, at least for a time, belonged to this group. Whether it extends to disenfranchisement or merely disdain, it is a potent political force.

I suppose that as a straight white male I have it relatively easy in this country. After all, there are people who will not vote for women, and who will not just refuse to vote for gay candidates but will go so far as to incite violence against them. But the rhetoric does not allow for legitimizing these opinions. It is disheartening that our politicians will through overt or subtle action legitimize the discrimination of opinions based upon the (non-)religion of their holder.

I struggled with calling my beliefs a non-religion, even parenthetically, because I take a somewhat active stance in my belief in the lack of any supernatural power. Hence the tweet. Mostly, I think that through furthering our understanding of the natural universe, we will eventually disavow ourselves of the notion of omnipotent beings and supernatural causes. I try not to instigate arguments with believers, but I feel as little reservation about stating my beliefs as the person who tells me to have a “blessed day” or offers unsolicited prayers for my ill family members.

So it’s not just a disagreement about two words inserted into the Pledge of Allegiance to bolster anti-communist propaganda at the height of the Cold War. It’s the implication that it’s okay to believe that this is a nation governed by and for Christians. It’s seeing the ugly wheels of domestic politics poke through the facade of statesmanship. And it’s about the wisdom of referencing a deity of the Judeo-Christian tradition in the same speech that is otherwise so sensitive to the perception that the American government is waging a war against Islam on behalf of its citizens.