How to Make a Basic Finite State Machine in Objective-C

后端 未结 5 2041
长发绾君心
长发绾君心 2020-12-07 17:45

I am attempting to build an FSM to control a timer in (iphone sdk) objective c. I felt it was a necessary step, because I was otherwise ending up with nasty spaghetti code c

5条回答
  •  醉酒成梦
    2020-12-07 18:29

    I suggest using State Machine Compiler, it will output Objective-C code. I have had good success in Java and Python using this.

    You shouldn't be writing state machine code by hand, you should be using something to generate the code for you. SMC will generate clean clear code you can then look at if you want to learn from it, or you can just use it and be done with it.

提交回复
热议问题