Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-24 Thread Laurent Sansonetti
Hi Łukasz, On May 24, 2009, at 3:39 AM, Łukasz Adamczak wrote: MacRuby can deal with specialized delegate methods like this one, but you need to generate a bridgesupport file for the framework you're targeting. Most frameworks that ship with Mac OS X are already covered, but in your case

Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-24 Thread Łukasz Adamczak
> MacRuby can deal with specialized delegate methods like this one, but you > need to generate a bridgesupport file for the framework you're targeting. > Most frameworks that ship with Mac OS X are already covered, but in your > case you might want to manually cover ObjectiveFlickr too. Wow. This

Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-22 Thread Laurent Sansonetti
Hi Łukasz, On May 22, 2009, at 1:58 AM, Łukasz Adamczak wrote: an NSNumber object should do it. Laurent, thanks for the answer. I believed that was the case. What about the delegate method case, though? I mean, the framework I'm playing with expects a certain delegate method and passes C uns

Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-22 Thread Łukasz Adamczak
> an NSNumber object should do it. Laurent, thanks for the answer. I believed that was the case. What about the delegate method case, though? I mean, the framework I'm playing with expects a certain delegate method and passes C unsigned ints to it: http://github.com/lukhnos/objectiveflickr/blob/

Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-21 Thread Laurent Sansonetti
Hi Łukasz, Since the bark method is defined in Ruby, it means its return value and arguments are objects (id). So, if you want to call the method from Objective-C, you must pass an Objective-C object. In this case, an NSNumber object should do it. If the bark method was actually an Objective-C me

Re: [MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-21 Thread Łukasz Adamczak
My question boils down to a simpler case: Ruby: class Dog def bark(num = 1) num.times { puts "woof!" } end end Objective-C: id dog = [[MacRuby sharedRuntime] evaluateString:@"Dog.new"]; [dog bark:3]; Passing Objective-C int to a Ruby method crashes it. Assumin

[MacRuby-devel] Crash with NSUInteger in delegate method

2009-05-20 Thread Łukasz Adamczak
Don't know if it deserves a ticket, so I'm posting here first. I'm trying to use ObjectiveFlickr from my MacRuby project: http://github.com/czak/flickrtest One of the ObjectiveFlickr delegate methods receives NSUIntegers from the library: http://github.com/lukhnos/objectiveflickr/blob/b480aa39fa0