Как определить UITableViewCellStyle после init? - PullRequest
0 голосов
/ 13 августа 2011

У меня есть следующий код для моей пользовательской ячейки:

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)?

1 Ответ

2 голосов
/ 13 августа 2011

Поскольку вы сказали, что пытаетесь установить стрелку вправо, вы, вероятно, хотите изменить принадлежность ячейки, а не стиль всей ячейки. Используйте свойство accessoryType ячейки:

[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...