Flex 的烦恼 - 关联数组 [英] Annoyances of Flex - Associative Array
本文介绍了Flex 的烦恼 - 关联数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个关联数组,在遍历这个数组时,使用 foreach 循环.Flex 正在失去订单.这太烦人了.
I have an associative array and while iterating through this array, using foreach loop. Flex is loosing the order. This is so annoying.
为什么会这样?
我怎样才能避免这种情况?
How can i avoid this?
推荐答案
根据规范,关联数组中的值不是有序"的.
Per the specification, the values in an associative array are not "ordered".
如果您需要按指定顺序获取值,则需要自己对键进行排序.
If you need to get values in a specified order, you'll need to sort the keys yourself.
这篇关于Flex 的烦恼 - 关联数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文