2D arrays using NSMutableArray
问题 I need to create a mutable two-dimensional array in Objective-C. For example I have: NSMutableArray *sections; NSMutableArray *rows; Each item in sections consists of an array rows . rows is an array that contains objects. And I want to do something like this: [ sections[i] addObject: objectToAdd]; //I want to add a new row In order have something like this: section 0, rows: obj1, obj2, obj3 section 1, rows: obj4, obj5, obj6, obj 7... Is there a way to do that in Objective-C? 回答1: First, you