- (void)viewDidLoad {
[super viewDidLoad];
definedNames = [[NSArray alloc] initWithObjects:@"Ohio", @"Newark", @"Steve", @"Coffee", nil];
definedAmounts = [[NSArray alloc] initWithObjects:@"5", @"100", @"1", @"72", nil];
}
例如。因此,数字与它匹配的名字去,但是当我搜索它与搜索到的名字UITableView搜索显示的单元格错误
搜索之前提出的数字仍然按照这个顺序: http://img855.imageshack.us/i/screenshot20110327at302.png
搜索纽瓦克: http://img849.imageshack.us/i/screenshot20110327at303.png
纽瓦克应保持100的价值。有人可以解释如何对我做这个请吗?我会很感激。我也有超过1000个条目和值显示在自定义单元格中。
感谢
如何让索引数组显示您的信息? – klefevre 2011-03-27 21:53:51
我不会分开这样的数据,为什么不只是一个数组与数组?例如,'self.stuff = [[NSArray alloc] initWithObjects:[NSArray arrayWithObjects:@“Ohio”,@“5”,nil],[NSArray arrayWithObjects:@“Newark”,@“100”,nil],nil ]'?然后设置你的tableview,你可以使用'[[stuff objectAtIndex:row] objectAtIndex:0];'作为名字,'[[stuff objectAtIndex:row] objectAtIndex:1];'为数字。带数组的 – 2011-03-27 21:58:25
数组。超过1000我将如何把这些放入tableview? – 2011-03-27 22:02:06