How can I convert an NSDictionary to an NSMutableDictionary?

后端 未结 4 1024

I have an existing NSDictionary that has:

{
    \"charts_count\" = 2;
    \"created_at\" = \"2010-04-12T16:37:32Z\";
    exchange = NASDAQ;
    \"followers_c         


        
4条回答
  •  一整个雨季
    2020-12-14 06:26

    NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] init];
    [newInfo setDictionary:info];
    

    Also works, since you are setting the dictionary not appending. You can also use:

    [newInfo addEntriesFromDictionary:info];
    

    for the same effect and to append to existing content.

提交回复
热议问题