Differences between MacRuby and RubyCocoa
Clone this wiki locally
MacRuby supports a new parameter syntax:
menu.addItemWithTitle(“Speak”, action: “speak:”, keyEquivalent: ’’)
In this example using
speak_ as the selector name doesn’t work, only
include OSX are unnecessary, because everything is defined on the main object.
There is no need to explicitly subclass
NSObject, because all classes inherit from it by default.
framework “Cocoa”, instead of
ib_action are deprecated. To set outlets, use standard
attr_accessor calls. To define actions, simply define methods that accept one argument named
objc_methods method. However, calling
methods passing the second parameter as true will return the list of Objective-C methods that the receiver responds to.