我UITableViewCell
在我的应用程序中有:
@interface ResultCell : UITableViewCell {
IBOutlet UILabel *name;
IBOutlet UILabel *views;
IBOutlet UILabel *time;
IBOutlet UILabel *rating;
IBOutlet UILabel *artist;
IBOutlet UIImageView *img;
}
@property (nonatomic, retain) UILabel *name;
@property (nonatomic, retain) UILabel *views;
@property (nonatomic, retain) UILabel *time;
@property (nonatomic, retain) UILabel *rating;
@property (nonatomic, retain) UILabel *artist;
@property (nonatomic, retain) UIImageView *img;
@end
所有这些都IBOutlet
在 Xib 文件中连接到UILabel
....
这就是我创建每个单元格的方式:
static NSString *CellIdentifier = @"ResultCell";
ResultCell *cell = (ResultCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
UIViewController *vc = [[[UIViewController alloc] initWithNibName:@"ResultCell" bundle:nil] autorelease];
cell = (ResultCell *) vc.view;
}
cell.name.text = item.name;
cell.views.text = item.viewCount;
cell.rating.text = [NSString stringWithFormat:@"%d%%",item.rating];
cell.time.text = item.timeStr;
cell.artist.text = item.artist;
我想知道在ResultCell
课堂上我是否需要实现一个dealoc方法并释放UILabel
?或者没关系,就像我所做的那样?我正在使用非 ARC,因为它是一个旧项目。