aybekckaya / sqlitepersistentobjects

Automatically exported from code.google.com/p/sqlitepersistentobjects
0 stars 1 forks source link

sortedFieldValuesWithKeysForProperty not working correctly #21

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use sortedFieldValuesWithKeysForProperty: 
2. Get allKeys from the returned dictionary
3. The ordering of the returned keys is not sorted correctly

What is the expected output? What do you see instead?

The expected output is a list of sorted property values. The list is not sorted 
because of the 
dictionary. I adapted the method on SQLitePersistentObject to return an array 
of orderered 
properties as well as the dictionary. 

Header and implementation of the working change attached...

What version of the product are you using? On what operating system?

SVN head

Please provide any additional information below.

See attached header and implementation for a working fix. We can't rely on 
dictionaries returning 
keys in the ordered they were added. 

Original issue reported on code.google.com by marc.nij...@gmail.com on 16 Dec 2008 at 12:44

Attachments:

GoogleCodeExporter commented 8 years ago
I'm going to deprecate sortedFieldValuesWithKeysForProperty: in favor of 
+(NSArray 
*)pairedArraysForProperties:(NSArray *)theProps which WILL preserve order, and 
will allow more than one field to 
be returned. Let me know if this doesn't meet your needs.

Original comment by jeff.lam...@gmail.com on 19 Feb 2009 at 1:22

GoogleCodeExporter commented 8 years ago
Yep, as long as it maintains order I'm all good

Original comment by marc.nij...@gmail.com on 20 Feb 2009 at 5:43