2011-08-13 5 views
0

私は私のカスタムセルのための次のコードを持っている:初期化した後、右矢印(UITableViewCellStyle)を設定する方法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; 

を? これにはプロパティまたはメソッド(initWithTyle以外)がありますか?

答えて

2

右矢印を設定しようとしているので、セルスタイル全体ではなく、セルのアクセサリを変更することを検討している可能性があります。セルのaccessoryTypeプロパティを使用してください:

[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 
+0

まさに私が欲しいものです、ありがとうございます。 – Kovu

関連する問題