Skip to content

megorei/block-return-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

###Sample Rubymotion Block Call Bug

Calling a Block which is returned from Ruby causes EXC_BAD_ACCESS

class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)


    BlockCaller.new.callBlockOn(RubyService.new)

    true
  end

  class RubyService
    def getBlock
      ->(text){ puts text }
    end  
  end  

end
#import "BlockCaller.h"

@implementation BlockCaller

- (void)callBlockOn:(id <RubyService>)rubyService {
  RubyBlock rubyBlock = [rubyService getBlock];
  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    rubyBlock(@"Hello From Objective C");
  });  
}

@end

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages