This class is very simple. It is usually used by pushviewcontroller and popviewcontroller.
What we will talk about here may be easily ignored.
First, use [uinavigationcontroller alloc] initwithrootviewcontroller: rootvc]. rootvc to access the uinavigationcontroller instance in a property such as navigationcontroller. Therefore, if you follow the memory management rules, who creates and who releases, you will encounter a problem that makes you very tangle, and all subsequent push calls will become invalid. It is similar to the following:Code:
Rootviewcontroller * viewcontroller = [[rootviewcontroller alloc] future: Nil Bundle: [nsundle mainbundle]; uinavigationcontroller * nav = [[uinavigationcontroller alloc] future: viewcontroller]; [nav release]; // This statement will invalidate all push operations.
The solution is to create an attribute to retain the nav. This clearly violates the general memory management principles. I don't know how it was designed.
Finally, record the related view geometric elements (which should have changed to iphone4/4s ):
1. Status Bar Height: 20. 40 when there is a call.
2. The height of the navigationcontroller navigation bar is 44, and that of the horizontal screen is 32.
3. tabbar, 48,
4. toolbars, 44.
5. keyboard. Generally, it is 320x216, and the screen is X. However, this operation is not accurate and can be obtained through callback.
6. In general, the button, label, and textfield must be at least 30 pixels high to display the text normally. (Default font ).