From: Gregory C. <gr...@in...> - 2011-08-03 20:53:59
|
I've also seen Core Animation problems with RubyCocoa on Lion that don't exist on Snow Leopard. But it's very easy to translate an app from RubyCocoa to MacRuby. Just be aware that there's no support for Leopard. Greg > Lion seems to have fundamentally broken RubyCocoa marshalling of > binary data for me - viz : > > DESCRIPTION OF PROBLEM > > On Lion I cannot create NSData objects from RubyCocoa if any of the > bytes have their top bit set. > > STEPS TO REPRODUCE > > The following code runs fine on 10.5 and 10.6, but segfaults in Lion > (you can just paste it into an irb prompt). > > require 'osx/cocoa' > include OSX > byte = 128 > bytes = [byte].pack('i_1') > NSData.dataWithBytes_length(bytes, bytes.length) > > 10.6 gives #<OSX::NSConcreteData:0x801bf550 class='NSConcreteData' > id=0x1013df110> > 10.7 gives /System/Library/Frameworks/RubyCocoa.framework/Resources/ruby/osx/objc/oc_wrapper.rb:50: > [BUG] Segmentation fault > ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] > > NOTES AND ATTACHMENTS > > The code runs fine on 10.5 and 10.6 > The code runs fine on 10.7 where byte < 128. > The segfault happens on 10.7 if any of the bytes in the bytes string is > 127 > The segfault also occurs when using CFDataCreate(0, bytes, > bytes.length), NSData.dataWithRubyString, NSData.alloc.init*, > NSMutableData.* - in fact, every way that I've tried to create an > NSData, leading me to believe that the something very fundamental in > the marshalling of strings as binary data is hosed. > > Has anyone else run into this issue, or am I the only person with who > had a live RubyCocoa app? > > Cheers > > Duncan McGregor > > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA > The must-attend event for mobile developers. Connect with experts. > Get tools for creating Super Apps. See the latest technologies. > Sessions, hands-on labs, demos & much more. Register early & save! > http://p.sf.net/sfu/rim-blackberry-1 > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |