
如果没有重载,就有编译器警告之类的。
现在的处理办法是在父类实现中抛出一个异常
但这只会在运行时直接 crash
而且如果之前不知道的话,在子类方法中有父类调用也会抛出这个异常....
1 Chrisplus 2016-11-02 14:44:30 +08:00 abstract ? |
2 wwwliangxin 2016-11-02 15:06:14 +08:00 如果是 Android 的话,可以 用 CallSuper https://developer.android.com/reference/android/support/annotation/CallSuper.html 也有第三方的 https://github.com/kotcrab/callsuper-annotation |
4 |
5 RedeemDx OP 这个难道不是 iOS 开发节点? |