map-type data structure?

Discussion in 'iPhone/iPad Programming' started by xytor, Apr 24, 2011.

  1. macrumors newbie

    Joined:
    Apr 16, 2011
    #1
    Does NSFoundation have a data structure like the std::map? NSMutableDictionary is close, but doesn't seem to have any way to check if a certain key is already inside.
     
  2. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    NSDictionary is it. objectForKey: tells you if there's an object stored with the specified key.
     
  3. thread starter macrumors newbie

    Joined:
    Apr 16, 2011
    #3
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Because Apple do not duplicate the documentation from superclasses in subclasses. The objectForKey: method (not function) is defined in NSDictionary which is NSMutableDictionaries superclass. So any NSDictionary method can be called on a NSMutableDictionary.
     
  5. thread starter macrumors newbie

    Joined:
    Apr 16, 2011
    #5
    Ooh that's good. My bad. Thanks for the clarification! :)
     

Share This Page