From: Stefan M. <ste...@po...> - 2007-12-04 21:50:31
|
Hello I have a question about calling Ruby methods from Objective-C. The Introduction from rubycocoa.com only shows you how to do this for a user-defined method that uses underscores. [helper helpfullyAddX:x toY:y] => def helpfullyAddX_toY(i,j) But how am I supposed to call a function like Object.instance_eval It takes multiple arguments, and has not enough underscores. It can also take a single block. obj.instance_eval ( aString <, file <, line> > ) obj.instance_eval ( { block } ) The bridge only tries to call the method with the block. So how do I call the other Version with 2 or 3 params? I've made a proxy method that's a better fit for bridge and then calls the Ruby method, but I don't think it's ideal. def evaluate_source(script, source) self.instance_eval(script, source) end regards, Stefan Mueller |