- (void)viewDidLoad {
[super viewDidLoad];
definedNames = [[NSArray alloc] initWithObjects:@"Ohio", @"Newark", @"Steve", @"Coffee", nil];
definedAmounts = [[NSArray alloc] initWithObjects:@"5", @"100", @"1", @"72", nil];
}
That for example. So the numbers go with the name it matches but when i search it puts the numbers still in that order with the searched names
before search:

searching for newark:

Newark should stay with the value 100. Can someone explain how to do this to me please? i would appreciate it. also i have over 1000 entries and the values are shown in a custom cell.
thanks
One way would be to use a dictionary. The keys could be names and values could be the numbers.
To get a number mapped to Newark:
An NSNumber is just a wrapper for a primitive and can be replaced where you use NSString, it writes out the number it wraps. Example NSLog(@”%@”, numberNewark); will write ‘100’ to console.