Thursday, November 15, 2012

+[NSURL URLWithString:] Changed

Mike Abdullah:

Once again it’s not in the URL documentation, but the behaviour of these methods actually depends on which SDK you link against. When running on OS X v10.6, or linking against the 10.6 SDK while running on a newer OS, they throw an exception when handed nil. Just like the other methods above.

If you link against the 10.7 SDK or newer, and are running on 10.7 or later, you instead get the more sensible & friendly behaviour of them returning nil. This change doesn’t even get a mention in the Foundation release notes!

Tags: , ,

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment