30 October 2007

interesting leopard feature

I dunno how they're doing this... but leopard knows how you got a binary somehow. At least I can't think of any other way to do this:

So that was accomplished by:

  1. download skype .dmg from skype.com with firefox to downloads dir (seen in very back window).
  2. mount .dmg (seen in left window)
  3. drag skype to applications (via alias in dmg)
  4. open applications folder (again, via alias; seen in right window
  5. run skype
  6. get freaky message

So thinking Skype did something funny, I pulled down my own software's disk image... knowing full well I didn't do anything special:

14 October 2007

stringWithContentsOfURL:encoding:error: throws NSDocumentedByMorons

If there's one thing I am intolerant of, it's ignorance. Especially in professionals. If you're paid to do something, then you had better well be able to do it! The great Paula, er, sorry, the *brillant* Paula, for example would get NO sympathy or appreciation from me.

So what then would I do about the folks responsible for the documentation for Foundation Framework's NSString class, in particular the masterpiece for stringWithContentsOfURL.

Take a good read of that documentation. It's the best you'll find for the function. Any reason then to think the following would NOT work?

NSURL * url = [NSURL URLWithString:@"http://www.google.com/"];
NSString * webpage = [NSString stringWithContentsOfURL:url

In theory, from any sane read of the docs, "webpage" should end up with the html of the given url in it.



After many hours of struggling with that code, and a number of trips to google and a couple of mac programming sites, I found one lone comment burried in a mailing list thread that said "oh, yeah, you can only use a file:// URL with that method."

Now I'm not sure that was a definitive statement from anyone @apple.com, since the post was from "email@hidden.domain" thanks to the web presentation of a mailing list archive. So either the docs are WOEFULLY inadequate, OR, the code has a HUGE bug in it. I'll let Apple's engineers figure that out. radr://5539874

Labels: , , ,