On Nov 1, 2011, at 5:06 PM, Matt Neuburg wrote: > CAGradientLayer *gradientLayer = [CAGradientLayer layer]; > gradientLayer.colors = [NSArray arrayWithObjects:(id)[[UIColor > darkGrayColor] CGColor], > (id)[[UIColor lightGrayColor] CGColor], nil]; > > And now we're back to my original question. Is that the right way?
Yes. > And why am I able to get away without saying __bridge id (or whatever), as I > would have to do if I were generating my own CGColor and not returning the > CGColor via a built-in method? Because the compiler has a special case wherein you can use an ordinary cast on the result of an Objective-C method that returns a CF type. -- Greg Parker gpar...@apple.com Runtime Wrangler _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com