KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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; }
Tags (comma-separated)
Save Edits
Cancel