2 Replies Latest reply on Nov 16, 2012 5:07 PM by Flex harUI

    Guaranteeing enumeration order in for-in loops




      I have exactly the same problem as this person:


      http://manishjethani.com/archives/2008/12/19/guaranteeing-enumeration-order-in-for-in-loop s


      and although the solution is good and a works I can't use it because I will be receiving an ArrayCollection of Objects not OrderedObjects and I can't change this, nor can I typecast the objects to OrderedObjects.  Any attempt to change the objects in the ArrayCollection to OrderedObjects involves enumerating the properties of the object and I'm back to the same problem of them not being in order.


      I can't believe they are listed in a random order, who would want this?  Nor can I believe that nobody has a proper fix for this but I've trawled the internet and only found the above solution.


      Anyone got any other suggestions?