我有以下scxml文件
<?xml version = "1.0"?>
<scxml version="1.0" name="statemachine" initial="initialState" xmlns="http://www.w3.org/2005/07/scxml" binding="early" exmode="lax">
<state id="initialState">
<transition target="state1" cond="TRUEPREDICATE" />
</state>
<state id="state1">
<transition target="state2" cond="SELF.currentStateName == 'state1'" />
</state>
<state id="state2">
<transition target="state1" cond="SELF.currentStateName == 'state2' && SELF.count < 5" />
<transition target="finalState" cond="SELF.currentStateName == 'state2' && SELF.count >= 5" />
</state>
<state id="finalState"/>
</scxml>我想使用NSXMLParser解析这个文件。我的想法是,当我点击按钮时,我们想要检查状态和目标。
我想要显示当前的状态值。
我该怎么做呢?
发布于 2012-10-03 19:37:22
整个文档将采用字典格式。在这个字典中,状态将是一个带有键id的字典,转换是另一个带有键,cond的字典。在-didStartElement__中,您可以获得这些值。
我猜,这对你很有效!!
https://stackoverflow.com/questions/12703588
复制相似问题