Use NSMutableArray NSMutableArray * arr2=[NSMutableArray array];//The first step: define an empty variable array
arr2=[NSMutableArray addObject:obj];//The second step is to put the elements you need inside. Your search method is not clearly written, so I only give you a rough idea here
NSMutableArray *arrF=[NSMutableArray addObject:arr2];//Construct a two-dimensional variable array
NSString * str = [[arrF ObjectAtIndex: (large array subscript)] ObjectAtIndex: (small array subscript)]; // Access elements in the array
Use NSMutableArray
NSMutableArray * arr2=[NSMutableArray array];//The first step: define an empty variable array
arr2=[NSMutableArray addObject:obj];//The second step is to put the elements you need inside. Your search method is not clearly written, so I only give you a rough idea here
NSMutableArray *arrF=[NSMutableArray addObject:arr2];//Construct a two-dimensional variable array
NSString * str = [[arrF ObjectAtIndex: (large array subscript)] ObjectAtIndex: (small array subscript)]; // Access elements in the array