将NSDictionary的所有键作为NSArray获取 [英] Get all keys of an NSDictionary as an NSArray

查看:68
本文介绍了将NSDictionary的所有键作为NSArray获取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从特定的NSDictionary中获取所有密钥作为单独的NSArray?

Is it possible to get all the keys from a specific NSDictionary as a seperate NSArray?

推荐答案

只需使用

NSArray*keys=[dict allKeys];

通常,如果您想知道某个特定的类是否具有特定的方法,请查找Apple自己的文档.在这种情况下,请参见 NSDictionary类参考.查看所有方法.您会发现许多有用的方法.

In general, if you wonder if a specific class has a specific method, look up Apple's own documentation. In this case, see NSDictionary class reference. Go through all the methods. You'll discover many useful methods that way.

这篇关于将NSDictionary的所有键作为NSArray获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆