Я совершенно не понимаю, почему мое вспомогательное представление не работает. Я просто хочу, чтобы какой-то текст отображался справа от UITableViewCell (а также слева), но отображается только текст слева.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"SwitchCell"];
if (cell==nil){
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"SwitchCell"] autorelease];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 60, 30)];
cell.textLabel.text = @"left text";
label.text = @"right text";
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.accessoryView = label;
[label release];
}
return cell;
}
Есть идеи? Спасибо.