Created
August 7, 2010 18:34
-
-
Save statonjr/513054 to your computer and use it in GitHub Desktop.
Calling unnamed selectors in MacRuby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tf = CAMediaTimingFunction.alloc | |
tf.send "initWithControlPoints::::".to_sym 0.5, 1.0, 0.5, 0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One way call unnamed selectors in MacRuby. If you have only two objects, you could call obj.performSelector(SEL, withObject:obj1, withObject:obj2). But -initWithControlPoints:::: takes 4 unnamed selectors, so I call Ruby's send method and convert the method name to a symbol (since -send wants a symbol).