当程序遇到超级删除行时会抛出异常吗?

时间:2014-07-21 10:22:39

标签: ios objective-c animation uiview

removeFromSuperviewUIView的选择器。 UIView的superClass为UIResponder,因此如果程序遇到代码[super removeFromSuperview],则UIResponder无法识别选择器removeFromSuperView。所以我的问题是:它会抛出无法识别的异常吗?

   - (void)removeFromSuperview
{
    [UIView animateWithDuration:0.35f delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
        self.frame = afterFrame;
        if (self.leftLeave) {
            self.transform = CGAffineTransformMakeRotation(-M_1_PI / 1.5);
        }else {
            self.transform = CGAffineTransformMakeRotation(M_1_PI / 1.5);
        }
    } completion:^(BOOL finished) {
        [super removeFromSuperview];
    }];
}

1 个答案:

答案 0 :(得分:1)

我假设您在UIView的子类中编写此代码,因为它似乎是最可能的情况。您可能已经注意到,它不会抛出异常,因为superUIView,而不是UIResponder

类层次结构为UIResponder -> UIView -> MyView