Re: Style Advice for using NSEnumerator
Re: Style Advice for using NSEnumerator
- Subject: Re: Style Advice for using NSEnumerator
- From: Carlton Gibson <email@hidden>
- Date: Tue, 18 May 2010 09:10:38 +0100
On 17 May 2010, at 20:57, Quincey Morris wrote:
> What's wrong with the direct approach? The best enumerator is no enumerator (written in Mail):
>
>> NSArray *strokeColors = [NSArray arrayWithObjects:
>> [UIColor redColor], [UIColor orangeColor, [UIColor yellowColor], [UIColor greenColor],
>> [UIColor blueColor], [UIColor cyanColor], [UIColor magentaColor], nil];
>>
>> NSUInteger colorIndex = 0;
>> for (float currentRadius = maxRadius;
>> currentRadius > 0;
>> currentRadius -= 20)
>> {
>> [[strokeColors objectAtIndex: colorIndex++ % strokeColors.count] setStroke];
>>
>> // Do Drawing
>> ...
>> }
>
> I don't need to look up any documentation to read that. :)
Of course! (Doh! :)
Thanks for the input everyone.
Regards,
Carlton_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden