NSView's bounds vs frame
From the View and Window Architecture Programming Guide for iOS:
A view object tracks its size and location using its frame, bounds, and center properties:
The frame property contains the frame rectangle, which specifies the size and location of the view in its superview’s coordinate system.
The bounds property contains the bounds rectangle, which specifies the size of the view (and its content origin) in the view’s own local coordinate system.
The center property contains the known center point of the view in the superview’s coordinate system.
Here is a good visualization of that explanation:
The bound's origin is not always 0,0. It's easy to understand the difference between frame and bounds, if you watch how change bounds property of UIScrollView during scrolling.
For example, you have UIScrollView with frame (0, 0, 320, 460), bounds (0, 0, 320, 460) and ContentSize (640, 460). Its frame always will be (0, 0, 320, 460), but the X coordinate of bounds will change depending on distance of scrolling.
It can be useful if you want to change something in you UIScrollView (create and remove pages diynamically for example), so you want to know distance of scrolling.
The apple documents in the first answer don't cover what happens to the frame and the bounds after rotating to landscape orientation. So to be more complete, you should know that the frame of the window and the root view does not change after rotation, but the bounds do. See this article for a a little more detail and be careful using frame as a reference for anything other than portrait orientation.
From the article:
If your view controller has the top-level non-window view (i.e., it’s the bottom-most view controller), then
self.frame
is always in portrait orientation. Wha? Yes, always in portrait – what changes is the transform of your view. So your
self.bounds
is always accurate (keeping in mind the last point), but
self.frame
may or may not give the aspect ratio that the user is really seeing, since each view’s frame is reported in terms of the superview’s coordinates, and takes into account any transforms applied to the view.