Skip to content

Commit

Permalink
Adjust event ordering such that the previous state gets a did exit ev…
Browse files Browse the repository at this point in the history
…ent before the new state gets a did enter
  • Loading branch information
blakewatters committed Jun 4, 2013
1 parent d70cd34 commit d0e231b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Code/TKStateMachine.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ - (BOOL)fireEvent:(id)eventOrEventName error:(NSError **)error
if (oldState.willExitStateBlock) oldState.willExitStateBlock(oldState, self);
if (newState.willEnterStateBlock) newState.willEnterStateBlock(newState, self);
self.currentState = newState;
if (newState.didEnterStateBlock) newState.didEnterStateBlock(newState, self);
if (oldState.didExitStateBlock) oldState.didExitStateBlock(oldState, self);
if (newState.didEnterStateBlock) newState.didEnterStateBlock(newState, self);

if (event.didFireEventBlock) event.didFireEventBlock(event, self);

Expand Down

0 comments on commit d0e231b

Please sign in to comment.