Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-21 Thread Laurent Sansonetti
Hi Alan, Indeed, if you link a specific framework into your project's executable in Xcode, its BridgeSupport file won't be loaded at runtime by MacRuby. I re-opened #1000 as I think MacRuby should do it for you, nevertheless. I believe this issue might hit other persons as MacRuby will gain pop

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-18 Thread Eloy Duran
Ah yes, this is one for a FAQ. Linking against a framework does not automatically make MacRuby read the BridgeSupport files that might be there. But if you use the MacRuby Kernel::framework method, it will do both. (Though it’s not necessary to do it from rb_main.rb, just before the code where y

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-18 Thread Alan Skipp
A wonderful prize indeed! Regarding the bug, I think I've been led astray by Xcode. If I add the framework in the usual way to an Xcode project, the class defintions within the framework become accessible to macruby. Therefore I assumed that by linking to the framework, macruby automatically lo

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-17 Thread Matt Aimonetti
Congratulations!! You won a lifetime license to use MacRuby 0.7.1 for free ;) I tested your framework and I wasn't able to reproduce the bug mentioned. I closed the ticket https://www.macruby.org/trac/ticket/1000#comment:2 But feel free to investigate more and reopen it if you find something new.

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-17 Thread Alan Skipp
Ticket #1000 has been filed. Does the 1000th ticket get a special prize? On 17 Nov 2010, at 14:39, Eloy Duran wrote: > That’s no good. Can you file a ticket? (Preferably with the test framework > attached) > > On Nov 17, 2010, at 3:34 PM, Alan Skipp wrote: > >> Thanks for the reply. I have the

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-17 Thread Eloy Duran
That’s no good. Can you file a ticket? (Preferably with the test framework attached) On Nov 17, 2010, at 3:34 PM, Alan Skipp wrote: > Thanks for the reply. I have the bridgesupport file located in the > '/Resources/BridgeSupport/' folder of the framework, but currently it is not > automaticall

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-17 Thread Alan Skipp
Thanks for the reply. I have the bridgesupport file located in the '/Resources/BridgeSupport/' folder of the framework, but currently it is not automatically loaded. I've tried making a clean build to no avail and I've checked the built app package and the framework is copied and the bridgesuppo

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-17 Thread Eloy Duran
The BridgeSupport file should be in a BridgeSupport directory inside the framework’s Resources directory. For example, Foundation’s BridgeSupport file is at: /System/Library/Frameworks/Foundation.framework/Resources/BridgeSupport/Foundation.bridgesupport On Nov 17, 2010, at 2:32 PM, Alan Skipp

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-17 Thread Alan Skipp
Thanks for the info. I'd wrongly assumed that as blocks can be treated as Objective-C objects that I could just go ahead and use them in Macruby. I have it working now, which is great, though I do have one more question. Initially I was receiving the same errors after I'd included the framework w

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-16 Thread Thibault Martin-Lagardette
Also, it is to note that if the block lives inside a framework you've made (or downladed – one that is not part of the system), you'll have to generate the BridgeSupport files yourselves. This is important because the runtime needs to know that you're trying to use blocks, and you instruct it to

Re: [MacRuby-devel] calling Objective-C method with block parameter

2010-11-16 Thread Matt Aimonetti
Did you install BridgeSupport preview 1? http://www.macruby.org/blog/2010/10/08/bridgesupport-preview.html It is required to use C blocks. Thanks, - Matt On Mon, Nov 15, 2010 at 2:51 AM, Alan Skipp wrote: > Hello everyone, > I'm attempting to call a method on an Objective-C object which takes

[MacRuby-devel] calling Objective-C method with block parameter

2010-11-15 Thread Alan Skipp
Hello everyone, I'm attempting to call a method on an Objective-C object which takes a block as its parameter, but I'm not having much luck. I can happily create the object in Macruby and send the message with a Proc. The NSLog call within the Objective-C method body succeeds, but the 'block()'