presentModalViewController完成滑动后如何制作动画?

| 我显示的登录屏幕有错误,例如:
_loginViewController.error = error;
[_navigationController presentModalController: _loginViewController
                                     animated: YES];
在LoginViewController中,我想将错误消息滑动到屏幕上,如下所示:
- (void)showErrorAnimated: (BOOL)animated;
{
    _errorLabel.text = [_error localizedDescription];

    [UIView beginAnimations: @\"showError\"
                    context: NULL];
    CGRect frame = [_errorView frame];
    frame.origin.y = 0; // starts at -frame.size.height
    [_errorView setFrame: frame];
    [UIView commitAnimations];
}
但是我不知道如何调用它来匹配视图控制器完成其滑动到屏幕顶部(由
presentModalController:animated:
开始)的时间。 我怎样才能使这个时间发挥作用?     
已邀请:
        您应该使用控制器的
viewDidAppear
方法,该方法将在显示视图时调用。 http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW17 请注意
viewDidAppear
,因为只要显示视图便会调用它。这意味着,如果您的控制器提供一个模态控制器,然后将其关闭,则将再次调用
viewWillAppear
viewDidAppear
方法。     

要回复问题请先登录注册