Developing for MacOS, I have an NSMutableArray namesArray[] that contains 3 String objects. namesArray[] is represented in a tableView, where user can select multiple cells, each cell represents a single object. I am trying to initialize a second NSMutableArray savedNamesArray[], and add objects from the original namesArray[] based on the selected cells in my tableView using this method:
NSMutableArray *savedNamesArray = [[NSMutableArray alloc] initWithObjects:[namesArray objectsAtIndexes:[_tableView selectedRowIndexes]], nil];
The problem is, no matter how many objects I select, only one gets added to the new NSMutableArray. Any suggestions?