title: Implementing State Machines with Enums in Objective C
body: <p>I need to implements the state machine in objective-c like this java code:</p>
  
  <pre><code>public enum State {
  
      INITIAL {
          @Override
          State doSomething(String aParameter) {
              System.out.println("Doing Something in INITIAL state and jumping to NEXT_STEP, argument = " + aParameter);
              return NEXT_STEP;
          }
      },
      NEXT_STEP {
          @Override
          State doSomething(String aParameter) {
              System.out.println("Doing Something in NEXT_STEP and jumping into FINAL, argument = " + aParameter);
              return FINAL;
          }
      },
      FINAL {
          @Override
          State doSomething(String aParameter) {
              System.out.println("I am in FINAL state, argument = " + aParameter);
              return this;
          }
      };
  
      abstract State doSomething(String aParameter);
  }
  </code></pre>
  
  <p>the reference link is:
  <a href="http://www.mirkosertic.de/doku.php/javastuff/enumstatemachine" rel="nofollow">http://www.mirkosertic.de/doku.php/javastuff/enumstatemachine</a></p>
  
  <p>someone can give me some suggestions?</p>