The hash dictionary is displayed for quick searches. You cannot correct your order.
If you want to keep in order, you must use arrays.
Or you need to use some complicated way, add int orderNumber(you need to increase it after each setObject / setValue) using the key. to save and search:
NSDictionary *dict=[NSDictionary new];
NSString *key=....;
[dict setValue:@"some value" forKey:[NSString stringWithFormat:@"%d-%@",orderNumber, key]];
.
-
@interface ....
@property(...) NSInteger index;
@property(...) NSString *key;
@property(...) id object;
@end
2:
, , . OrderedDictionary.