ios - How to add a NSArrays with 2 Integer dimension to NSMutableArray in Objective-C -


i have nsmutablearray , want add 2 dimensional nsarray integer parameters each time. after use values they're ids not integers.and tried @[i,j] didn't work. here code :

resault = [[nsmutablearray alloc]initwithcapacity:40];  (int i=0; i<5; i++) {    (int j=0; j<5; j++)    {       [resault addobject:@[@(i),@(j)]];    } } 

use code -

nsmutablearray*resault = [[nsmutablearray alloc]initwithcapacity:40]; (int i=0; i<5; i++) {     nsmutablearray*array = [[nsmutablearray alloc]initwithcapacity:40];     (int j=0; j<5; j++)     {         [array addobject:@[@(i),@(j)]];     }     [resault addobject:array]; } 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -