[MacRuby-devel] Method calls with variable unnamed arguments after the pseudo-hash part of the selector

Caius Durling caius at caius.name
Sun Oct 10 11:53:38 PDT 2010


On 10 Oct 2010, at 19:46, Caio Chassot wrote:

> I'm playing again with implementing the Hillegass book in MacRuby, and ran across this method:
> 
>    + (NSAlert *)alertWithMessageText:(NSString *)messageTitle
>                        defaultButton:(NSString *)defaultButtonTitle
>                      alternateButton:(NSString *)alternateButtonTitle
>                          otherButton:(NSString *)otherButtonTitle              
>            informativeTextWithFormat:(NSString *)informativeText, ...
> 
>    (http://bit.ly/d1JIeQ)
> 
> Now, the interesting part here is the ", ..." at the end. It takes variable arguments at the end that work as formatting arguments for informativeText, eg. sprintf(informativeText, ...).


Does it work if you pass an array in as the last argument? That's my assumption upon encountering it and trying to use it.

C
---
Caius Durling
caius at caius.name
+44 (0) 7960 268 100
http://caius.name/



More information about the MacRuby-devel mailing list