rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

wrong number of arguments exception using BW::UIActivityViewController #364

Closed birdy101 closed 10 years ago

birdy101 commented 10 years ago

I am using UIActivityViewController like this:

    @share.on(:touch) do |sender|
      BW::UIActivityViewController.new(
         items: ["Some Text", NSURL.URLWithString('http://www.rubymotion.com')],
         animations: true,
         excluded: :add_to_reading_list
      )
    end

However, with the above code when I click on the button I get this error:

2014-04-06 15:52:30.326 my_rmq_app[19085:80b] 
uicontrol.rb:93:in `call:event:': wrong number of arguments (1 for 0) 
(ArgumentError)
2014-04-06 15:52:30.336 my_rmq_app[19085:80b] 
*** Terminating app due to uncaught exception 'ArgumentError', 
reason: 'uicontrol.rb:93:in `call:event:': wrong number of arguments 
(1 for 0) (ArgumentError)
'

I was trying to implement this answer in ObjC: http://stackoverflow.com/a/22897584/654203

$ motion --version
2.24
Using bubble-wrap (1.5.0)
clayallsopp commented 10 years ago

Hi, it looks like you're using BubbleWrap 1.5.0, which does not include the BW::UIActivityViewController wrapper, which will be in the next release.

You'll need to hit the master version of BubbleWrap in your Gemfile:

gem 'bubble-wrap', git: "https://github.com/rubymotion/BubbleWrap.git"