开发者

editingStyleForRowAtIndexPath Scrolling problem

I am facing a very strange problem with editingStyleForRowAtIndexPath method. I am planing to change the appearance of editable cells. It was working fine, but when i scroll the table i am not getting the table cell pointer in the editingStyleForRowAtIndexPath delegate method. So the new cells does not get the custom appearance.

I am using this -

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath开发者_Go百科 
{

    // 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 ... 




}

Thanks in advance!


I think the table view may call this method before it assigns a cell to the given index path. A more reliable way to customize table view cells would be to override -tableView:willDisplayCell:forRowAtIndexPath:. You can test the cell's editingStyle property there and act accordingly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜