ios StoryBoard定制表单元

(将Lable标签的tag设置为30,在属性检查器里设置哦亲。)

cellForRowAtIndexPath方法如下:

– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @”Cell”;
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
   
    // Configure the cell…
    if(cell == nil){
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    UILabel *nameLabel = (UILabel *)[cell viewWithTag:30];  
    nameLabel.text = [goods_names objectAtIndex:indexPath.row];
   
    return cell;
}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注