Closed sdaitzman closed 7 years ago
Did you try what you've got above? CocoaScript lets you use brackets.
@ccgus thank you for your prompt response!
I prefer the dot-notation syntax for this project, and I am using a build tool that will not work without formatting that way. I've been unable to find any reliable guidelines for how to go from the Objective-C bracket syntax to dot notation.
You can replace objc's :'s with _'s. Using CocoaScript Editor's pre processor, it'll turn the above into this:
fill.setColor_( MSImmutableColor.colorWithSVGString_( colors[r]));
If there are multiple arguments to a method, then you'd do this:
[f call:a whatever:b];
f.call_whatever_(a, b)
@ccgus thank you! This is very helpful.
For example: how would I go from
[fill setColor:[MSImmutableColor colorWithSVGString: colors[r]]];
to the equivalent in JS property syntax (dot-notation)?Thank you so much for the help.