I am new to objective-c (Xcode) program.
I would like to know how to get event when a view's focus gettting and losing focus.
The view is not disposed. Just there is another subView added to the window.
[self.window addSubview:anotherView.view]
So there will not be viewWillDisappear, viewDidDisappear, viewWillAppear, viewDidAppear for the original load view... :(
Thank you very much.
You don't really need one, because you are controlling the adding and removal of the views. However, you can override - (void)didAddSubview:(UIView *)subview
in your view subclass (UIView or NSView).
According to the docs:
The default implementation of this method does nothing. Subclasses can override it to perform additional actions when subviews are added. This method is called in response to adding a subview using any of the relevant view methods.