I am trying to add items from an NSArray to an NSMutableArray like so:
for(int i = 0; i < [tableData count]; i++){
[purchaseOrder.objects addObject:[tableData objectAtIndex:i]];
NSLog(@"%@",[tableData objectAtIndex:i]);
}
NSLog(@"%@", purchaseOrder.objects);
but purchaseOrder.objects
returns nil: here is what NSLog(@"%@",[tableData objectAtIndex:i]);
is returning:
2015-04-30 08:57:36.510 MyApp[7055:1475885] {
POIndex = "094 Spray Foam";
PONumber = "ABC123/028";
}
2015-04-30 08:57:36.511 MyApp[7055:1475885] {
POIndex = "095 Drywall";
PONumber = "ABC124/029";
}
2015-04-30 08:57:36.511 MyApp[7055:1475885] {
POIndex = "100 Stairs";
PONumber = "ABC125/032";
}
I am looking for away to have the PONumber as the key and POIndex as the value. Here is how my arrays are defined:
MasterController:
@property NSMutableArray *objects;
Detailer Controller:
NSArray *tableData = [dataSource.areaData GetPurchaseOrderItems:[NSString stringWithFormat:@"%@%@",areaPickerSelectionString,unitPickerSelectionString]];