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

后端 未结 5 2038
长发绾君心
长发绾君心 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:44

    When you use a protocol as a type-modifier, you can provide a comma-separated list of protocols. So all you need to do to get rid of the compiler warning is add NSObject to the protocol list like so:

    - (void)setupTimer:(id) timerState {
    
        // Create scheduled timers, etc...
    }
    

提交回复
热议问题