title: Java HashMap to iOS
body: <p>I am a pure Java/c# developer. But now after building my native Android app, I am trying to extend my knowledge with iOS (Objective_c). Now I am at the point that there is a little difference between iOS and Android. I am trying to convert my Java HashMap to one in iOS, but found out that there is no equivalent for the iOS version.</p>
  
  <p>My Java HashMap for my Android app looks like this: </p>
  
  <pre><code>Map&lt;String, String&gt;
  </code></pre>
  
  <p>Now I want the same for my iOS app. But I can't see the solution. I've did some research and found out that there is something like NSDictionary or NSMutableDictionary that can help me out.</p>
  
  <p>After a little more effort I found out that a NSDictionary is immutable, but the NSMutableDictionary data structure lets you dynamically add and remove entries as necessary. So I think I could use NSMutableDictionary for my HashMap to dynamically add/remove stuff in it.</p>
  
  <p>After a more research ont the internet, I found out that it is possible to do the following:</p>
  
  <pre><code>NSMutableDictionary *testHashMap = @{
      @"FirstKey" : "FirstItem",
      @"SecondKey" : "SecondItem",
      @"ThirdKey" : "ThirdItem",
      @"FourthKey" : "FourthItem"
  };
  </code></pre>
  
  <p>Is this a good way to build a HashMap in objective_c (iOS)? Or is there something better?</p>
  
  <p>Now I want to add a fifth item. How is it possible to do this? Is there something like:</p>
  
  <pre><code>testHashMap.add("FifthKey", "FifthItem");
  </code></pre>
  
  <p>And how do I get an item out of the testHashMap in iOS? Do I have to do something like this:</p>
  
  <pre><code>String secondItem = testHashMap("SecondKey");
  </code></pre>
  
  <p>Thank you for all the help!</p>