• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Style Advice for using NSEnumerator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Style Advice for using NSEnumerator (From: Carlton Gibson <email@hidden>)
 >Re: Style Advice for using NSEnumerator (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: BarView won't run
  • Next by Date: Specify "Sent Action on" Behavior of NSTextField
  • Previous by thread: Re: Style Advice for using NSEnumerator
  • Next by thread: Re: Style Advice for using NSEnumerator
  • Index(es):
    • Date
    • Thread