开发者

How to retrieve all keys from a dictionary?

开发者 https://www.devze.com 2023-03-28 14:34 出处:网络
How can I retrieve all the keys (only) from a NSDictionary? I do not need them in any particu开发者_JAVA百科lar order.Use the allKeys method on your NSDictionary.

How can I retrieve all the keys (only) from a NSDictionary? I do not need them in any particu开发者_JAVA百科lar order.


Use the allKeys method on your NSDictionary.

From the docs:

allKeys : Returns a new array containing the dictionary’s keys.

- (NSArray *)allKeys    

Return Value

A new array containing the dictionary’s keys, or an empty array if the dictionary has no entries.


I advise you to study the Dokumentation. ;-) Take a look here:

- (NSArray *)allKeys;

From the Dokumentation:

Returns a new array containing the dictionary’s keys.

  • (NSArray *)allKeys

Return Value A new array containing the dictionary’s keys, or an empty array if the dictionary has no entries.

Discussion The order of the elements in the array is not defined.

0

精彩评论

暂无评论...
验证码 换一张
取 消