- (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