Why doesn’t [NSDictionary allKeys] return a set?

前端 未结 5 1185
南笙
南笙 2021-02-12 16:10

Is there a reason for NSDictionary to return its keys as NSArray instead of NSSet? The documentation already states that the order of the

5条回答
  •  耶瑟儿~
    2021-02-12 16:52

    use use c++, std::map provides access to its keys as a set. the set returned is even "live" , the set reflects the ongoing current set of keys. of course you are free to make a copy as well.

提交回复
热议问题