CAGradientLayer *grad = [CAGradientLayer layer];
grad.colors = $array(ColRGBA2(1, 0, 0, 1), ColRGBA2(0, 1, 0, 1), ColRGBA2(0, 0, 1, 1), ColRGBA2(0, 0, 0, 0));
grad.startPoint = CGPointMake(0, 0);
grad.endPoint = CGPointMake(1, 0);
grad.colors = $array(ColRGBA2(1, 0, 0, 1), ColRGBA2(0, 1, 0, 1), ColRGBA2(0, 0, 1, 1), ColRGBA2(0, 0, 0, 0));
in this sentence have a dollar sign what does this mean?any links about it?
That’s not a feature of the language, these are convenience intializers for collections that some people use. For example:
expands to:
I’m not sure if it’s worth the trouble. And I don’t have a link to the library that provides these macros, maybe somebody else does?
By the way, it looks like we will have official literals for arrays, dictionaries and some other objects in Xcode 4.4. The details appear to be under NDA at the moment, but there’s some discussion at Hacker News.