From: Stefan M. <ste...@po...> - 2007-12-05 01:20:06
|
Hello Thanks for the quick answer. It looks like the workaround, that I mentioned at the end of my message was actually the right way to do it. The only difference is, that you convert the NSCFString to String. Is this step very important? If the NSString has been autoreleased, will Ruby retain it to keep the AutoreleasePool from dealloc-ing? Knowing about objc_method will also be useful. stefan mueller On Dec 5, 2007, at 01:32 , Satoshi Nakagawa wrote: > Hi, > > For example, you need to make a callable method from ObjC in a ruby > class: > > def evalScript_source(script, source) > instance_eval(script.to_s, source.to_s) > end > > -- > Satoshi Nakagawa > > On 2007/12/05, at 6:50, Stefan Mueller wrote: > >> Hello >> >> >> 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 > |