Flex关联数组的问题 [英] Annoyances of Flex - Associative Array

查看:216
本文介绍了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.

Why is this happening?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆