我有一個尷尬的問題,調用[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];
}
任何提示將是偉大的,我真的卡在這裏:'(
allready已經嘗試過了,needdisplay也一樣。目前爲止沒有任何工作:'(我認爲這與重新使用標識符有關,但是什麼? – clenemt