我有一個tableview,在NSMutableArray內部有由NSMutableDictionaries填充的自定義單元格。具有雙值的TableView單元格
現在,我想檢查[email protected]"Location"
上方的單元格當前正在填充。因爲,如果該位置相同,那麼下面的單元格應該留下一些標籤blanco。
例如:
[Thing on location: Building A has problem X]
[ and problem Y ]
[Thing on location: Building B has problem X]
(是的,我知道,表的一個貧窮的 '圖紙',哈哈)。
不管怎樣,在cellForRowAtIndexPath
我已經試過代碼:
if ((indexPath.row - 1) > -1)
{
NSString *eerste = [[NSString alloc] initWithFormat:@"%@", [[lijstErrors objectAtIndex:(indexPath.row - 1)] objectForKey:@"Location"]];
NSString *tweede = [[NSString alloc] initWithFormat:@"%@", [incInRow objectForKey:@"Location"]];
NSLog(@"Comparing %@ met %@", eerste, tweede);
}
的問題是,它永遠不會被調用。我的猜測是,cellForRowAtIndexPath
不是每次填滿單元格時調用的?任何提示?
你能if語句之前轉儲'indexPath.row'?並滾動,這看起來是正確的,仍然沒有人知道... – 2011-04-26 08:59:22