[MacRuby-devel] Mixing Objective-C and Ruby classes
macruby-devel at principia.info
Mon Apr 20 04:49:22 PDT 2009
Many thanks John and Laurent.
After reading your messages I came back to XCode and discovered I had
made a typo in the ObjC part of the code (which, curiously, compiled)
and that's why my ruby code didn't find my selector.
As for calling ruby code from the obj-c side, I agree it's a bit
convoluted (not to mention deprecated). I hope there's a better way to
do that in store for upcoming versions. If I understood well your
example, you first created the Obj-C subclass and later, dynamically,
set its parent to be the ruby class. Anyway, seeing that the norm in
Cocoa is delegation rather than extension, and if all ruby classes are
readily available in Obj-C, I think I'll manage with just calling ruby
code instead of extending it. Apparently I lacked only calling the
sharedRuntime method, will need to experiment a bit more when I get
back to my Mac.
Victor Jalencas <victor at carotena.net>
More information about the MacRuby-devel