views:

94

answers:

2

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.

+2  A: 

Have you tried using the UITableViewCellStyleSubtitle UITableViewCellStyle? I'm guessing that the style you're using might not support the detail text.

David Kanarek
+1  A: 

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

willcodejavaforfood