NSURL, I loath thee
Friday, January 25th, 2008So I know I shouldn’t complain too much, coming from Safari not too long ago, but I felt I must rant about something. In my quest to bring YouTube support to FlickrBooth (is that app name even going to make sense after such a feature?) I’ve come to the sad realization that NSURL sucks. It doesn’t have a feature-rich enough API, making you have to break down to CF functions. It makes you use important to forget string functions like [NSString stringByAddingPercentEscapes] which have fun ways of creating bugs you didn’t anticipate. It lacks any sort of GET/POST automatic query generation. It has no helper functions for cookies, which are this entirely separate-but-shared entity. I feel like Apple ported (or did they write it from scratch?) it on top of WebKit for Panther and basically let it wither without any substantial feature additions since. I suppose on one hand you could argue that it means the API will remain stable, making it easier for future development but Apple does seem to have a hit and run policy of releasing a new awesome library, then basically never touching it again except for bug fixes. WebKit in particular I would not account such harsh words to. The API adapts quite rapidly, despite many additional functions winding up on the “Unofficial but available” headers. But this is by virtue of it’s OpenSource facing policy. AppKit/Foundation doesn’t exactly have the same liberal policy.





