How to get object for key from NSDictionary?

后端 未结 3 1805
耶瑟儿~
耶瑟儿~ 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:36

    For starters, you might want to make that an actual string, like so:

    [dict objectForKey:@"alba's window"];
    

    Note also that \U2019 is not '; but , which is a different character entirely.

    And more generally, sticking to [a-zA-Z0-9]+ for dictionary keys is probably a good idea, unless you are inserting and retrieving programmatically using the exact same string as a key.

提交回复
热议问题