Hampton Lintorn Catlin
Hampton Catlin is the co-founder and CEO of Wordset, an online collaborative dictionary, and rarebit. He is also the inventor of Sass, Haml, and m.wikipedia.org . He's the founder of the libsass project and the author of "The Pragmatic Guide to Sass." He was formerly mobile lead at the Wikimedia Foundation and CTO of Moovweb, helping large companies build better interfaces.
Also, my husband, Michael Lintorn Catlin, has a blog you should checkout if you want to follow what we're up to, non-professionally.
Macruby IB Received Actions and IBAction
Here is another bit of undocumented macruby. If you are building a custom object in macruby (either extending objc object or a ruby object) and you want to list “Receive Action” in Interface Builder, then there is a little trick to make this happen. First, I had this:
def set_font_size(value) # blah end
But… I couldn’t hook it up in IB! It just wouldn’t list. This isn’t at all what I wanted! In obj-c, IB knows that its an action if it is defined like this:
IBAction is really an alias of void, but its just a little trick that obj-c uses to figure out that we want to make it publicly available to IB. However, in macruby, we can’t specify the return type. After reading enough examples, I gave something crazy a try. What if the name of the arg matters?
def set_font_size(sender) # blah end
And there it appears. Damnit! Always call the arg “sender” and you will have your macruby methods show up as actions in interface builder. Macruby is too smart for its own good and the documentation is just…. lame. We need merbist to finish his book fast!