0
我想設置已知大小的二維數組的值:試圖在已知大小的2d NSMutableArray中指定一個值?
想這一點,但它失敗:
[[ppp objectAtIndex:1] objectAtIndex:3] = @"dog";
或
[[ppp insertObject: @"dog" AtIndex:1] AtIndex:3]; //<<-- still doesn't like
感謝
我想設置已知大小的二維數組的值:試圖在已知大小的2d NSMutableArray中指定一個值?
想這一點,但它失敗:
[[ppp objectAtIndex:1] objectAtIndex:3] = @"dog";
或
[[ppp insertObject: @"dog" AtIndex:1] AtIndex:3]; //<<-- still doesn't like
感謝
-objectAtIndex:
不會返回一個值,但沒有你可以分配給(即不是一個左值)。請使用-replaceObjectAtIndex:withObject:
。
[[ppp objectAtIndex:1] replaceObjectAtIndex:3 withObject:@"dog"];