开发者

2 Dimensional array within another 2dimensional array in Objective C

开发者 https://www.devze.com 2023-03-18 02:33 出处:网络
I am looking for an method to create and mulidimensional array in objective C. my requirement is an array similar to

I am looking for an method to create and mulidimensional array in objective 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

I would appreciate it if anyone could help me in how i can initialize such ar开发者_如何学编程rays in objective-c . Thank you


check this

2D arrays using NSMutableArray


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.

0

精彩评论

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

关注公众号