| As a wannabe-rubyist who thinks reading Obj-C is somewhere between having a migraine and using H2SO4 eye drops, so far I'm in love with the language. I'm doing lots of tripping over the Cocoa APIs, though, in no small part due to Xcode. The error messages you get when you've done something wrong are unintuitive at best and downright misleading at worst. Example: I've got a field I want to render an image in. It's represented as an object of type NSImageCell. I've got my image file defined as an object of type NSImage. So far, so good. I type the . after the image cell, and I'm presented with a number of autocomplete suggestions. One of which is a method called "setValue" which accepts an object as an argument. Okay cool. myCell.setValue(NSImage(named: "myImage"))
Compile and.. instacrash with "Unrecognized selector"What? Some research turns up that this error means you've tried to send a message to (call a method on) something that doesn't accept that type of message. Turns out that the method I needed is called setObjectValue. And it also accepts an object as an argument. So, Xcode. Why did you give me setValue as an autocomplete when it isn't valid on that object? Why are these method names nearly identical? facepalm And that's before I get into the almost completely worthless inline error messages. "Cannot convert to $T1". What? I really, really like the language, but Xcode is trying its damndest to turn me away. I've got a stack of bugs/feature requests that need to be entered into Apple's reporting tool - hopefully some of these are just warts that'll get fixed as Xcode 6 comes out of beta. |