How to get object for key from NSDictionary?

后端 未结 3 1740
耶瑟儿~
耶瑟儿~ 2021-02-20 02:04

In dictionary named dict the key value pair is:

\"alba\\U2019s window\" = \"A model in westindies.\";

And to send

3条回答
  •  温柔的废话
    2021-02-20 02:54

    Since iOS6 onwards, a convenient method for setting and accessing the object for a key from an NSDictionary is:

    //Setting the object in NSMutableDictionary
    dictionary[@"someKey"] = @"someString";
    
    //Accessing the object
    NSString *str = dictionary[@"someKey"];
    

提交回复
热议问题