What is the difference between adding the subview to self and or to the content view?
Subview added to self
- (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;
Subview added to 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;