【发布时间】:2016-05-31 16:07:28
【问题描述】:
我对 [UIView init] 和 [UIView initWithFrame:xx] 感到困惑,在我搜索 stackoverflow 后发现以下问题和答案:
Why do both init functions get called
iOS: UIView subclass init or initWithFrame:? 然后我知道 initwithFrame 是设计的初始化程序,让我对答案感到困惑的是,当我们调用 [myview init](myView 是 UIView 的子类并覆盖 init 和 initwithfrme :) 时,它会调用 [super init] 然后它会call [super initWithFrame:xx] as super 会在 super 类中找到方法,为什么它会调用 [myView initWithFrame:xx]???
【问题讨论】:
标签: ios objective-c uiview super