2011-08-13 31 views
0

我有我的自定義單元格下面的代碼:如何在init之後定義UITableViewCellStyle?

ENSCustomCell *cell = (ENSCustomCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 
if (cell == nil) 
{ 
    cell = [[[ENSCustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:cellIdentifier] autorelease]; 
} 

NSUInteger row = [indexPath row]; 
NSDictionary *ens; 
ens = [ensList objectAtIndex:row]; 

NSDictionary *toDic = [ens objectForKey:@"an"]; 
NSString *toString = @""; 
NSInteger count = 0; 
for (NSDictionary *str in toDic) 
{ 
    count++; 
    toString = [NSString stringWithFormat:@"%@%@", toString, [str objectForKey:@"username"]]; 
    if (count != toDic.count) 
    { 
     toString = [NSString stringWithFormat:@"%@%@", toString, @", "]; 
    } 

} 
[cell setDataWithTitle:toString andSubject:[ens objectForKey:@"betreff"]]; 
return cell; 

如何設置初始化後,右箭頭(UITableViewCellStyle)? 是否有一個屬性或方法(否則,然後initWithTyle)呢?

回答

2

既然你說過你試圖設置正確的箭頭,你可能想要改變單元的附件而不是整個單元格的樣式。使用電池的accessoryType屬性:

[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 
+0

正是我想要的,謝謝。 – Kovu

相關問題