¿Cuál es la diferencia entre agregar la subvista a uno mismo y/o a la vista de contenido?Subclasificando UITableViewCell correctamente?
subvista añadió a la libre
- (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) {
UIImage *img = [UIImage imageNamed:@”lol.jpg”];
UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
[self addSubview:imgView];
[imgView release];
return self;
}
subvista añadido a contentView
- (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) {
UIImage *img = [UIImage imageNamed:@”lol.jpg”];
UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
[self.contentView addSubview:imgView];
[imgView release];
return self;
}