0
我面對一個非常奇怪的問題與editingStyleForRowAtIndexPath方法。我打算改變可編輯單元格的外觀。它工作正常,但是當我滾動表格,我沒有得到editStyleForRowAtIndexPath委託方法中的表格單元格指針。所以新的單元格不會獲得自定義外觀。提前editingStyleForRowAtIndexPath滾動問題
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
// get tablviewcell pointer
UITableViewCell* pCell = [tableView cellForRowAtIndexPath:indexPath]; // <- not getting the pointer when scrolling the table and new cells come up
//Changin cell appearance here ...
}
謝謝 -
我現在用這個!
你好Costique, 我剛查了這一點,並發現該方法在此順序執行 1) - (UITableViewCell的*)的tableView:(UITableView的*)的tableView的cellForRowAtIndexPath:(NSIndexPath *)indexPath 2) - (UITableViewCellEditingStyle)的tableView :(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath 3) - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 但我無法獲得第三種方法本身的單元格。 請幫忙!! – Saurabh 2010-07-20 12:42:40
奇怪。表視圖在-tableView中作爲單元參數發送了什麼(第二個):willDisplayCell:forRowAtIndexPath:?該方法是否被調用?如果沒有,請檢查實現該方法的對象是否實際上是表視圖的委託。 – Costique 2010-07-20 13:10:14