Posts

Showing posts from December, 2011

UIView: Notification for view loaded

Depending on what kind of actions you need to perform, there are several techniques: -(id)initWithFrame:(CGRect)frame  - UIView's designated initializer; always sent to a UIView to initialize it, unless the view is loaded from a nib; -(id)initWithCoder:(NSCoder *)coder  - always sent to initialize a UIView whenever the view is loaded from a nib; -(void)awakeFromNib  - sent after all the objects in the nib are initialized and connected; applicable only if you load the object from a nib; you must call super; -(void)willMoveToSuperview:(UIView *)newSuperview  - sent immediately before the view is added as a subview to another view;  newSuperview  may be nil when you remove the view from its superview; -(void)willMoveToWindow:(UIWindow *)newWindow  - sent immediately before the view (or its superview) is added to a window;  newWindow  may be nil when you remove the view from a window; -(void)didMoveToSuperview  - sent immediately after the view is inserted into a view hierar