Custom Cell not getting redrawn three20

问题描述:

我有一个尴尬的问题,调用[self invalidateModel];不会重绘我的自定义单元格。Custom Cell not getting redrawn three20

我有一个TTTableViewController与一个操作表,允许按下时命令显示一个表。数据正确重绘,但单元格未重绘。取而代之的是重用。

为了说明更好:
在我的我的CustomTableItemCell类- (void)layoutSubviews {我有这样的:

if (bookmarked) { 
     UIImage *bookmark = [UIImage imageNamed: @"[email protected]"]; 
     TTImageView *bookmarkView = [[TTImageView alloc] init]; 
     bookmarkView.defaultImage = bookmark; 
     bookmarkView.frame = CGRectMake(297, 0, 16, 27); 
     [self.contentView addSubview:bookmarkView]; 
     TT_RELEASE_SAFELY(bookmarkView); 
} 

基本上如果我得到一个书签的项目,我想显示在我的手机右侧的丝带。此功能区正确显示。
当我用动作表方法重新命令我的单元格并调用invalidateModel时,没有任何ribon的第一个单元格会被放在之前是一个带状物品的位置,但不会重绘该单元格,从而为物品提供一个ribon没有丝带。

代码来源:
这是我TTTableViewController我的createDataSource功能:

- (void)createModel { 
    self.dataSource = [ServiceRequestDetailedDataSource viewDataSource:self.typeOfAction andOrderBy:orderBy]; 
    // If dataSource nil, show an empty Message 
    if (self.dataSource == nil) { 
     [self showEmpty:YES]; 
    } 
} 

这是改变排序依据,并呼吁无效我TTTableViewController我的动作片动作模式:

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { 
    if (buttonIndex == 0) { 
     self.orderBy = @"portfolio"; 
    [self invalidateModel]; 
} 

任何提示将是伟大的,我真的卡在这里:'(

找到它,只是使用reuseidentifier。我的错。

也许[自装]会帮助您更新单元格视图。在模型失效后调用它

+0

allready已经尝试过了,needdisplay也一样。目前为止没有任何工作:'(我认为这与重新使用标识符有关,但是什么? – clenemt