[英]2 Dimensional array within another 2dimensional array in Objective C
I am looking for an method to create and mulidimensional array in objective C.我正在寻找一种在目标 C 中创建和多维数组的方法。
my requirement is an array similar to我的要求是一个类似于
float array = new float [3*2];
float array = new float [[3*2][3*2]];
these two being in a java format这两个采用 java 格式
I would appreciate it if anyone could help me in how i can initialize such arrays in objective-c.如果有人能帮助我如何在 objective-c 中初始化这样的 arrays,我将不胜感激。 Thank you
谢谢
Objective-C is a superset of C, and any C code is valid Objective-C as well - so, this is a link to creating multidimensional arrays in C: Wikipedia's Article: C syntax - Multidimensional arrays Objective-C is a superset of C, and any C code is valid Objective-C as well - so, this is a link to creating multidimensional arrays in C: Wikipedia's Article: C syntax - Multidimensional arrays
However, if you're looking for the Objective-C way to do it, that would be to use NSMutableArray
or NSArray
.但是,如果您正在寻找 Objective-C 方法,那就是使用
NSMutableArray
或NSArray
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.