我有一個plist,我試圖按順序訪問它的動畫(在PList中定義),但是當我將它存儲在NSDictionary中,然後嘗試逐個播放動畫時,它是不按順序播放它們。 e.g,從PList閱讀字典時的錯誤順序
int index = 0;
[self playAnimation:[animTypes objectAtIndex:index++]];
[self playAnimation:[animTypes objectAtIndex:index++]];
這是我的plist的代碼:
<plist version="1.0">
<dict>
<key>Boy</key>
<dict>
<key>Enter</key>
<dict>
<key>disabled</key>
<false/>
<key>halfCycle</key>
<true/>
<key>fps</key>
<integer>1</integer>
<key>defaultFrame</key>
<integer>0</integer>
<key>useZwoptex</key>
<true/>
<key>frames</key>
<array>
<string>boy-000.png</string>
</array>
</dict>
<key>Jump</key>
<dict>
<key>disabled</key>
<false/>
<key>halfCycle</key>
<true/>
<key>fps</key>
<integer>13</integer>
<key>defaultFrame</key>
<integer>0</integer>
<key>useZwoptex</key>
<true/>
<key>frames</key>
<array>
<string>boyjump-000.png</string>
<string>boyjump-001.png</string>
<string>boyjump-002.png</string>
</array>
</dict>
<key>Turnaround</key>
<dict>
<key>disabled</key>
<false/>
<key>halfCycle</key>
<true/>
<key>fps</key>
<integer>21</integer>
<key>defaultFrame</key>
<integer>0</integer>
<key>useZwoptex</key>
<true/>
<key>frames</key>
<array>
<string>boyturnaround-000.png</string>
<string>boyturnaround-001.png</string>
<string>boyturnaround-002.png</string>
</array>
</dict>
</dict>
</plist>
PLZ指導我如何加載序列中的動畫?
每次都是不同的隨機順序還是每次都是相同的順序(但是錯誤的)? – deanWombourne 2010-07-02 08:12:30
這是相同的順序,但錯誤。例如:2,4,1,3 – user381810 2010-07-02 09:55:36