简体   繁体   English

NSArray作为二维数组

[英]NSArray as two dimensional array

Can anybody suggest which is the best way for using NSArray as two-dimensional array to store data for filtering data based on field. 谁能建议使用NSArray作为二维数组存储数据以基于字段过滤数据的最佳方法。

Thanks in advance 提前致谢

Regards, sathish 问候,sathish

you can create an 1. array of arrays, 2. array of dictionaries, 3. array of custom class objects.. 您可以创建1.数组数组,2.字典数组,3.自定义类对象的数组。

In any case you will have to do almost equal amount of work for filtering based on field.. 无论如何,您都需要做几乎相同数量的工作才能根据字段进行过滤。

Because you didn't provide any context for your question, is there a reason why you aren't using a 2-dimensional C array to store data? 因为您没有为问题提供任何上下文,所以是否有理由不使用二维C数组来存储数据? (You can use C primitives, types and structs in Objective-C just fine.) Is there a reason why you need to use NSArray ? (您可以在Objective-C中使用C原语,类型和结构就可以了。)是否有理由需要使用NSArray (Is it the right tool for the job?) (这是工作的正确工具吗?)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM