M mauro vicamini Active Member Licensed User Longtime User Feb 5, 2016 #1 Hi evryone, probably I'm wrong but I've found a strange behavior with map data type and iOS 9 (more exactly 9.2.1): I've an app that insert into a map some data and I've found that in debug mode the inserted item is always put like the last item but in release mode is inserted always like the first element. In iOS 7 both release and debug mode always act the same inserting the item as last element. Have you notice this strange behavior? It have cause me a lot of troubles because I was using the map like a LIFO queue and with the same data it returned me differents results from iOS7 and iOS9. Thanks for the attention
Hi evryone, probably I'm wrong but I've found a strange behavior with map data type and iOS 9 (more exactly 9.2.1): I've an app that insert into a map some data and I've found that in debug mode the inserted item is always put like the last item but in release mode is inserted always like the first element. In iOS 7 both release and debug mode always act the same inserting the item as last element. Have you notice this strange behavior? It have cause me a lot of troubles because I was using the map like a LIFO queue and with the same data it returned me differents results from iOS7 and iOS9. Thanks for the attention
Erel B4X founder Staff member Licensed User Longtime User Feb 5, 2016 #2 You shouldn't rely on the order or items in the Map. If the order is important then also add the keys to a List. Upvote 0
You shouldn't rely on the order or items in the Map. If the order is important then also add the keys to a List.
M mauro vicamini Active Member Licensed User Longtime User Feb 5, 2016 #3 It's what of I've done than. But It's really strange because I've done several tests with the same data and always gave me the same result, the only difference is in iOS 9 debug mode. Really strange. Upvote 0
It's what of I've done than. But It's really strange because I've done several tests with the same data and always gave me the same result, the only difference is in iOS 9 debug mode. Really strange.
moster67 Expert Licensed User Longtime User Feb 5, 2016 #4 From: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/ Note that in most implementations of maps the order is not preserved. In most use cases the order is not important. The order in B4A and B4J maps is preserved. This is not the case in B4i. Click to expand... Upvote 0
From: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/ Note that in most implementations of maps the order is not preserved. In most use cases the order is not important. The order in B4A and B4J maps is preserved. This is not the case in B4i. Click to expand...