The difference between IOS development Loadview and Viewdidload
These two methods are essential to the development of the iphone. They can all be used to initialize some content when the view is loaded. But what difference do they have?
Viewdidload This method is called only when view is initialized from the nib file.
Loadview This method is called when the controller's view is nil. This method is used when creating a view programmatically. Such as:
- -(void) Loadview {
- UIView *view = [[UIView alloc] initwithframe:[uiscreen
- Mainscreen]. Applicationframe];
- [View Setbackgroundcolor:_color];
- Self.view = view;
- [View release];
- }
You implement the Loadview method in the controller, then you may be called by the memory management control at some point when the application is running. If the device is low on memory, the view controller receives a didreceivememorywarning message. The default implementation is to check whether the current controller's view is in use. If its view is not inside the view hierarchy currently in use and your controller implements the Loadview method, the view will be release and the Loadview method will be re-used to create a new view.
The difference between IOS Loadview and Viewdidload