From: Allison N. <dem...@ma...> - 2008-06-13 04:21:20
|
Nat, I can't help you with the bridge, but I'm guessing that Apple's Scripting Bridge documentation should be of interest in doing what you are trying to do. If you haven't already looked at it, this may help: http://developer.apple.com/documentation/Cocoa/Conceptual/RubyPythonCocoa/Articles/GenerateFrameworkMetadata.html#/ /apple_ref/doc/uid/TP40005426 As mentioned on that page, the manpage ('man BridgeSupport 5' in the terminal) also gives some important information. Other than that, I can't really help you for the bridge. If all of that gets too hard, you might try just writing a plain ol' C extension to Ruby, which can also do what you want if all you want is to call Ruby from Objective-C, and not the inverse. As for having multiple copies of ruby installed on your system, it won't cause you any dramas if you are just trying to run the app from inside XCode, or even a a standalone. But I had all sorts of problems when i wanted to run some rspec unit tests, or run my app inside irb to debug it. My system kept trying to use my copy of ruby stored in / usr/local/bin, which wasn't compiled with --enabled-shared. Worse still, its LIBRARIES variable didn't have the RubyCocoa framework in its path either. I ended up just deleting that version of ruby, along with its friends (irb, erb, ri, rdoc etc). If I ever need it again, I'll be making sure that it's correctly compiled to work wth RubyCocoa when I install it. So be very careful with this, here be dragons... Alli Le 13 juin 08 à 02:37, Nathaniel Irons a écrit : > Is there a source of good documentation for objc_method? I'm trying > to call, from Obj-C, a three-argument Ruby method taking an array > and two strings, and returning a boolean. I'm getting inconsistent > results owing to my lack of understanding -- sometimes the returned > result isn't typed as boolean, sometimes calling the method raises > an exception about the wrong number of arguments. I started with > examples from this page: > > http://limechat.net/rubycocoa/bridge_test.html > > But I'm don't recognize the "B@:@@" syntax, which is proving google- > resistant. > > I see some commentary about improved boolean handling in the release > notes for .13, but I can't tell how much trouble I'll be biting off > if I move beyond the Leopard-bundled framework. Any problem > reverting, if necessary? > > While I'm asking, the .13.2 installer warns "If you overwrote > Apple's Ruby with a custom version, please make sure that it has > been built with --enabled-shared." I trust this is aimed at people > who replaced /usr/bin/ruby for some reason, and not applicable to > upstanding individuals with oddball /usr/local/bin/ruby. --enabled- > shared is fine, I just don't want to discover down the road that my > deployment targets expect similarly oddball ruby installations. > > Thanks, > > -nat > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |