[Impromptu] Formatting strings (printf-style)
Glen F
holaglen at gmail.com
Wed Mar 11 16:18:46 GMT 2009
Hi there -- a quick question: how to format strings? I've tried
using NSString, but I'm not super-familiar with the ObjC bridge...
It doesn't seem to want to work with "stringWithFormat:", which takes
a variable number of arguments. Impromptu returns "too many
arguments passed, ignoring additional arguments".
What am I doing wrong?
;----------
(define nsstring (objc:call "NSString" "stringWithFormat:" "rounded:
%.2f" 3.14159))
(print nsstring)
;----------
This prints out (besides the logged warning about 'too many arguments'):
#<OBJC: rounded: 0.00>
Thanks,
Glen.
More information about the Impromptu
mailing list