Iteration over enum in Objective C?

Although the question is already answered, here are my two cents:

enum Colour {
    white = 0,
    pink,
    yellow,
    blue,

    colorsCount // since we count from 0, this number will be blue+1 and will be actual 'colors count'
} Colour;

for (int i = 0; i < colorsCount; ++i)
  someFunc((Colour)i);

I guess it’s not that bad and is pretty close to the fast enumeration you want.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)