lookng at the code from the book :
CGRect viewFrame = CGRectMake(160, 240, 100, 150);
HypnosisView *view = [[HypnosisView alloc] initWithFrame:viewFrame];
[view setBackgroundColor:[UIColor redColor]];
[[self window] addSubview:view];
CGRect anotherFrame = CGRectMake(120, 130, 50, 50); HypnosisView *anotherView = [[HypnosisView alloc] initWithFrame:anotherFrame]; [anotherView setBackgroundColor:[UIColor blueColor]]; //[[self window] addSubview:anotherView]; [view addSubview:anotherView];[/code]
In this case ‘anotherView’ is drawn OUTSIDE (the bounds) its superview ‘view’. I am sure this is “working as intended” but to me it doesnt make sense. A subView, in my mind, should never be outside the bounds of its superView in a parent->child relationship but in this case it is happening. Any thoughts about this?