I have an NSComboBox and I'm trying to make it so that when the user selects a name, the other information (rate, rate type, and nationality) get automatically inputted. It works sometimes, but it causes an error at other times.
This code:
- (void)controlTextDidEndEditing:(NSNotification *)aNotification{
NSInteger index = [_nameBox indexOfItemWithObjectValue:[_nameBox stringValue]];
_lblRate.stringValue =[[contents objectAtIndex:index] objectForKey:@"Rate"];
NSInteger rateType =[[[contents objectAtIndex:index] objectForKey:@"RateType"] integerValue];
[_rateTypeSwitcher setSelected:YES forSegment:rateType];
[_nationalityMenu selectItemWithTitle:[[contents objectAtIndex:index] objectForKey:@"Nationality"]];
}
causes this error:
Ignoring exception raised in void run_cocoa_block(void *): *** -[__NSArrayM objectAtIndex:]:
index 9223372036854775807 beyond bounds [0 .. 1]