[英]how to add the content of the cell of table view in other view when clicked on cell in objective-c
[英]how can i put the second line in the table view cell in objective-c?
我正在使用以下代碼以相同的方式添加下一行,但是我沒有得到輸出。
cell.detailTextLabel.text= [self.dataArray1 objectAtIndex:indexPath.row];
其中dataarray1是以下數組。
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];
我如何在表視圖的同一單元格中添加更多內容。
您是否嘗試過使用UITableViewCellStyleSubtitle
UITableViewCellStyle? 我猜您正在使用的樣式可能不支持詳細文本。
初始化時必須設置單元格的樣式,以便顯示詳細文本。
- (id)initWithStyle:(UITableViewCellStyle)stylereuseIdentifier:(NSString *)reuseIdentifier
您正在尋找的樣式是UITableViewCellStyleSubtitle
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.