在 Objective-c 中如何创建一个抽象类?

2016-05-16 17:09:35 +08:00
 helloword001
3150 次点击
所在节点    程序员
6 条回复
helloword001
2016-05-16 17:34:36 +08:00
??????
Artail
2016-05-16 19:53:19 +08:00
OC 没有抽象类。。
juxingzhutou
2016-05-16 20:55:10 +08:00
init 方法里抛出异常
xingzhela
2016-05-16 21:39:46 +08:00
@juxingzhutou 什么意思
toono
2016-05-17 00:15:05 +08:00
没有抽象类,你可以写一个基类结合断言`NSAssert(false, @"Over ride in subclasses");`
holy_sin
2016-05-17 10:03:19 +08:00
参照 RACStream

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/279008

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX