#664: MacRuby Crashes When Scheduling a Block to Run on the Main Thread from a Background Thread ---------------------------------+------------------------------------------ Reporter: dy...@… | Owner: lsansone...@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------
Comment(by lsansone...@…): Proc#call is currently not directly callable from C/ObjC. Can you try this workaround instead: {{{ def main_thread( &block ) o = Object.new def o.call @block.call end o.instance_variable_set(:@block, block) o.performSelectorOnMainThread( 'call', withObject: nil, waitUntilDone: true ) end Thread.new do main_thread do [1,2,3].each {|i| puts i } end end }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/664#comment:2> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel