Clarification regarding viewDidAppear: and friends
Clarification regarding viewDidAppear: and friends
- Subject: Clarification regarding viewDidAppear: and friends
- From: WT <email@hidden>
- Date: Sat, 28 Mar 2009 20:11:51 +0100
Hello,
I'm a bit confused by the documentation regarding UIViewController's
viewDidAppear:, viewDidDisappear:, viewWillAppear:, and
viewWillDisappear:.
Consider what the documentation says for viewDidAppear:
===
viewDidAppear:
Sent to the controller after the view fully appears and animations end.
- (void)viewDidAppear:(BOOL)animated
Parameters
animated
If YES, the appearance of the view is animated; otherwise, it is not.
Discussion
The default implementation of this method does nothing. Subclasses may
override this method to take an appropriate action. When doing so,
they must invoke super.
===
I have 3 questions:
1) If the default implementation does nothing, why must I invoke super
when overriding this method?
2) viewDidAppear: and its friends all take a boolean argument but I
don't understand what it's for. In the case of viewDidAppear:, for
instance, the view has already been fully displayed, so what
animations is the description above talking about? Note, for instance,
that the description explicitly says
"Sent to the controller after the view fully appears and animations
end."
So, again, if the animations have ended, what's the boolean argument
for?
3) The documentation for each of those methods says:
"Subclasses may override this method to take an appropriate action.
When doing so, they must invoke super."
Now, should I invoke super before or after my custom code?
I will send a documentation enhancement request, but I thought I'd
check with the list first to make sure I'm not missing something
obvious.
Thanks in advance.
Wagner
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden