开发者

iphone detailtext in UITableView question

So, I am able to create an array that populates the fields of the Table, but am having troubles creating the subtext that appears below the main fields. I currently have:

- (void)viewDidLoad {
[super viewDidLoad];
listOfForms = [[NSMutableArray alloc] init];
[listOfForms addObject:@"First Form"];
 }

and then:

    NSString *cellValue = [listOfDAForms objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;

in the cellForRowAtIndexPath portion. Why can't I add:

listOfNames = [[NSMutableArray alloc] init];
[listOfNames addObject:@"Named Form"];

and

NSString *cellSubscript = [listOfNames objectAtIndex:indexPath.row];
cell.detailTextLabel开发者_如何学Python.text = cellSubscript;

in order to make the little subview work? What am I doing wrong?


Be sure to init your cell with the style UITableViewCellStyleSubtitle

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜