I have an NSMutableOrderedSet
which contains NSDate
objects. Initially, here are the values:
2014-10-08 12:46:48 +0000
2014-10-08 12:46:42 +0000
After calling addObject
with 2014-10-08 12:45:40 +0000
, I get the following output:
2014-10-08 12:46:42 +0000
2014-10-08 12:46:48 +0000
2014-10-08 12:45:40 +0000
Why aren't they ordered?
an
NSMutablOrderedSet
is not like a JavaTreeSet
which is kept sorted. Look ataddObject:
documentation:You should manually call
or