I am going through the Stanford iPhone dev lectures on iTunes and ran into this in Lecture 5.
We are trying to ensure a redraw will be done when the device rotates. I have two questions related to this:
- What is
awakeFromNib
? There's no call to this method in the rest of the code. How was it triggered? - What does the codes inside
initwithFrame:
do?
.
-(void)setup
{
self.contentMode = UIViewContentModeRedraw;
}
-(void)awakeFromNib
{
[self setup];
}
-(id)initWithFrame:(CGRect)frame
{
self=[super initWithFrame:frame];
if (self) {
[self setup];
}
return self;
}