Ios 自定义标签未显示在自定义单元格中。故事板

Ios 自定义标签未显示在自定义单元格中。故事板,ios,uitableview,storyboard,Ios,Uitableview,Storyboard,我已经看了所有相关的问题,但我仍然无法让它工作 我创建了一个自定义cell.xib(foodCell.xib),并将其文件所有者设置为foodCell.h。我还将标识符设置为foodCell 到目前为止,我在自定义单元格中只有一个自定义标签-pricelab。我遇到的问题是,我似乎无法为自定义标签设置值或在运行时显示它 这是我的foodcell.h文件: #import <Parse/Parse.h> @interface foodCell : PFTableViewCell

我已经看了所有相关的问题,但我仍然无法让它工作

我创建了一个自定义cell.xib(foodCell.xib),并将其文件所有者设置为foodCell.h。我还将标识符设置为foodCell

到目前为止,我在自定义单元格中只有一个自定义标签-
pricelab
。我遇到的问题是,我似乎无法为自定义标签设置值或在运行时显示它

这是我的foodcell.h文件:

#import <Parse/Parse.h>

@interface foodCell : PFTableViewCell


@property (weak, nonatomic) IBOutlet NSObject *foodCell;

@property (weak, nonatomic) IBOutlet UILabel *priceLabel;


@end

}在
viewDidLoad

[self.tableView registerNib:[UINib nibWithNibName:@"foodCell" bundle:nil] forCellReuseIdentifier:@"foodCellIdentifier"];
然后在
cellforrowatinexpath
中:创建如下单元格

 static NSString *CellIdentifier = @"foodCell";
 foodCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

如果你登录cell.pricellabel,你会得到什么?你在tableView上注册了你的笔尖吗?这就是你需要的吗?谢谢Bilal,这肯定让我很接近。现在我将代码更改为上面发布的注册配置,我的initWithStyle:UITableViewCellStyleSubtitle不再受尊重。我的字幕和图像都消失了,要查看我的客户价格标签,我必须点击手机。我做了什么?@user3085646您可以在XIB中将单元格样式设置为字幕样式
 static NSString *CellIdentifier = @"foodCell";
 foodCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];