I ran the code from the book and it was just right. However, I then tried to make the reallyBigRect 4 times larger than the whole window (rather than 2) and when I ran it the text was no longer in the view. I believe that the offset should be computed as:
// center the hypnosis view in the scrollview CGPoint offset; offset.x = (reallyBigRect.size.width - wholeWindow.size.width)*.5; offset.y = (reallyBigRect.size.height - wholeWindoe.size.height)*.5; [scrollView setContentOffset:offset];
essentially centering the scroll view inside the bigger rectangle. It is a happy coincidence that the code in the book works for scroll views half the size of the external view.