Skip to content

Instantly share code, notes, and snippets.

@statonjr
Created August 7, 2010 18:34
Show Gist options
  • Save statonjr/513054 to your computer and use it in GitHub Desktop.
Save statonjr/513054 to your computer and use it in GitHub Desktop.
Calling unnamed selectors in MacRuby
tf = CAMediaTimingFunction.alloc
tf.send "initWithControlPoints::::".to_sym 0.5, 1.0, 0.5, 0.0
@statonjr
Copy link
Author

statonjr commented Aug 7, 2010

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment