怎么将一个数组的内容放到tableview的cell中

2025-05-19 14:49:45
推荐回答(1个)
回答1:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

NSString *string = nil;

UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:string];

if (cell==nil) {

cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:string];

}

//Array就是我的数组

cell.textLabel.text = [[Array objectAtIndex:indexPath.row] objectAtIndex:2];

cell.detailTextLabel.text = [[Array objectAtIndex:indexPath.row] objectAtIndex:6];