From: Motohiro T. <mo...@gm...> - 2007-07-15 06:32:45
|
Hi, While writing QuartzComposer CustomPatch with RubyCocoa, I'm in trouble with passing arguments from Objective-C code to Ruby. How can I pass more than one arguments to Ruby code from Objective-C code ? Objective-C code: - (BOOL)execute:(id)fp8 time:(double)fp12 arguments:(id)fp20 { Class helperClass = NSClassFromString(@"CustomRubyPatch"); rubyobj_ = [[helperClass alloc] initWithQCPatch:self]; [rubyobj_ execute:fp8 time:fp12 arguments:fp20]; return YES; } and Ruby code: def execute(fp8, time, arguments) @otport.setStringValue @inport.stringValue.gsub(/Objective-C/, "Ruby") true; end when [rubyobj_ execute:...] is invoked at runtime, an exception is raised ("selector not recognized"). thanks, -- Motohiro Takayama http://blog.deadbeaf.org/ |
From: Satoshi N. <sna...@in...> - 2007-07-15 07:10:07
|
Hi. > While writing QuartzComposer CustomPatch with RubyCocoa, I'm in > trouble with passing arguments from Objective-C code to Ruby. > How can I pass more than one arguments to Ruby code from Objective-C code ? Try this: objc_method :execute_time_arguments, %w|char id double id| def execute_time_arguments(fp8, fp12, fp20) ... end You can see documents of RubyCocoa in your machine: /Developer/Documentation/RubyCocoa/programming.en.html (English) /Developer/Documentation/RubyCocoa/programming.ja.html (Japanese) -- Satoshi Nakagawa |
From: Motohiro T. <mo...@gm...> - 2007-07-15 09:01:28
|
It works, thanks ! I searched that information on web, because the local documents seemed to be obsolete... but I will look up that for now. 2007/7/15, Satoshi Nakagawa <sna...@in...>: > Hi. > > > While writing QuartzComposer CustomPatch with RubyCocoa, I'm in > > trouble with passing arguments from Objective-C code to Ruby. > > How can I pass more than one arguments to Ruby code from Objective-C code ? > > Try this: > > objc_method :execute_time_arguments, %w|char id double id| > def execute_time_arguments(fp8, fp12, fp20) > ... > end > > You can see documents of RubyCocoa in your machine: > > /Developer/Documentation/RubyCocoa/programming.en.html (English) > /Developer/Documentation/RubyCocoa/programming.ja.html (Japanese) > > -- > Satoshi Nakagawa > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > |
From: Laurent S. <lsa...@ap...> - 2007-07-15 11:35:23
|
We should definitely summarize this in a wiki page on the website. We already have a page but it's empty :( If someone is willing to fill it :) http://rubycocoa.sourceforge.net/RubyFromObjectiveC Laurent On Jul 15, 2007, at 11:01 AM, Motohiro Takayama wrote: > It works, thanks ! > > I searched that information on web, because the local documents seemed > to be obsolete... > but I will look up that for now. > > 2007/7/15, Satoshi Nakagawa <sna...@in...>: >> Hi. >> >>> While writing QuartzComposer CustomPatch with RubyCocoa, I'm in >>> trouble with passing arguments from Objective-C code to Ruby. >>> How can I pass more than one arguments to Ruby code from Objective- >>> C code ? >> >> Try this: >> >> objc_method :execute_time_arguments, %w|char id double id| >> def execute_time_arguments(fp8, fp12, fp20) >> ... >> end >> >> You can see documents of RubyCocoa in your machine: >> >> /Developer/Documentation/RubyCocoa/programming.en.html (English) >> /Developer/Documentation/RubyCocoa/programming.ja.html (Japanese) >> >> -- >> Satoshi Nakagawa >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |