iOS Question UnReadOnly Map.IsReadOnly?

Mashiane

Expert
Licensed User
Longtime User
Thanks a lot, thought of such and had already written a loop function. This will do..
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
I had done this...

B4X:
Sub UnReadOnlyMap(sourceMap As Map) As Map
    ' copy a map to a new map to make it IsReadOnly = False
    If sourceMap.IsReadOnly = False Then Return sourceMap
    ' the map is readonly, convert it
    Dim newMap As Map
    newMap.Initialize
    ' copy each map item
    For Each key As String In sourceMap.Keys
        Dim val As Object = sourceMap.Get(key)
        newMap.Put(key,val)
    Next
    Return newMap
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…