the future is in beta

home about

Define action parameter in UIBarButtonItem

28 Mar 2013

Although RubyMotion is great, sometimes is hard to know how to use some Cocoa methods or parameters. This is how you translate an action parameter (SEL)action:

UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh 

refreshButton = UIBarButtonItem.alloc.initWithBarButtonSystemItem(
      UIBarButtonSystemItemRefresh, target:self, action:'refreshMeasures')    

where refreshMeasures is a method defined in the class

def refreshMeasures