#import <UIKit/UIKit.h>
@interface MyTableViewCell : UITableViewCell
@property(nonatomic,retain) UILabel *firstLabel;
@property(nonatomic,retain) UILabel *secondLabel;
@property(nonatomic,retain) UILabel *thirdLabel;
@end
#import "MyTableViewCell.h"
@implementation MyTableViewCell
-(void)dealloc{
||
||
[_firstLabel release],_firstLabel = nil;
[_secondLabel release],_secondLabel = nil;
[_thirdLabel release],_thirdLabel = nil;
[super dealloc];
}
- (void)awakeFromNib {
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
_firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, 10, 10)];
_firstLabel.backgroundColor = [UIColor redColor];
[self.contentView addSubview:_firstLabel];
_secondLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 20, 10, 10)];
_secondLabel.backgroundColor = [UIColor yellowColor];
[self.contentView addSubview:_secondLabel];
_thirdLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 30, 10, 10)];
_thirdLabel.backgroundColor = [UIColor cyanColor];
[self.contentView addSubview:_thirdLabel];
}
return self;
}