how can i put the second line in the table view cell in objective-c?
I am using the following code to add the next line in the same same but i am not getting the output.
cell.detailTextLabel.text= [self.dataArray1 objectAtIndex:indexPath.row];
where dataarray1 is the following array.
self.dataArray1 = [NSArray arrayWithObjects:@"sugar : 1 teaspoon", @"salt : 1 teaspoon",@"sugar : 1 teaspoon", @"salt : 1 teaspoon",@"sugar : 1 teaspoon", @"salt : 1 teaspoon",@"sugar : 1 teaspoon"开发者_如何学编程, @"salt : 1 teaspoon",nil];
how can i add the more content in the same cell of table view.
Have you tried using the UITableViewCellStyleSubtitle
UITableViewCellStyle? I'm guessing that the style you're using might not support the detail text.
You have to set the style of the cell when you init it for it to show the detail text.
- (id)initWithStyle:(UITableViewCellStyle)stylereuseIdentifier:(NSString *)reuseIdentifier
the style you are looking for is UITableViewCellStyleSubtitle
精彩评论