Hello, On 2005-04-03 07:15:35 +0100 Richard Frith-Macdonald <[EMAIL PROTECTED]> wrote:
> On 2005-04-02 22:51:50 +0100 Frederico Mu�oz <[EMAIL PROTECTED]> wrote: > >> The problem I'm having is that when I deserialize the data into a >> NSDictionary to perform the copy operations that filenames appear in random >> order, (...) > The order of keys in a dictionary is undefined (nothing to do with > serialization ... that's the case wherever you use a dictionary or set) ... > so you can't depend on key ordering. What you can do is simply serialize an > additional object ... an array containing all the keys in the correct order > ... so then to do the copy you simply deserialize both the dictionary and the > array, then iterate through the array using the values as keys to obtain the > files you need to copy. Ah, ok, thanks. I was mixing the efect for the cause, since I saw the serialized data (in XML) in the right order I assumed that the "problem" was with the deserialization process. I will do as you told, add an array. I also read about the sort methods of NSDictionary, but didn't get far because it works on the keys, and I at most could add a "Order" key with a value in the NSDictionary that is the value for the key. Best regards, fsmunoz -- Frederico Mu�oz _______________________________________________ Gnustep-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnustep-dev
