NSObject 的类层次结构
我试图理解类层次结构。 NSObject
有哪些子类。是否有层次结构的图形表示?
I trying to understand class hierarchy. What are the sub classes of NSObject
. Is there any graphical representation of the hierarchy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
NSObject 是大多数 Objective-C 类层次结构的根类,子类从中继承运行时系统的基本接口和行为能力作为 Objective-C 对象。
https://developer.apple.com/documentation/objectivec/nsobject
我发现了这个这张图在 Google 上显示继承关系。
Chris 撰写了一篇综合博客(只需阅读第 12 章):
https://codewithchris.com/swift-tutorial-complete/#uikit
第 12 章
NSObject is the root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system and the ability to behave as Objective-C objects.
https://developer.apple.com/documentation/objectivec/nsobject
I found this this diagram on Google showing the inheritance relationships.
A comprehensive blog is written by Chris (Just read Chapter#12):
https://codewithchris.com/swift-tutorial-complete/#uikit
Chapter 12
您可以在 Xcode 项目中的符号导航器的层次结构视图中探索层次结构。请务必取消选择下面的文档图标以显示所有符号,而不仅仅是项目中定义的符号。
You can explore the hierarchy in the hierarchical view of the Symbols navigator in a Xcode project. Be sure to de-select the document icon below to display all symbols and not just those defined in your project.
Project>Class Browser
下的类浏览器将显示所有类的层次结构视图。他们有很多。The class browser under
Project>Class Browser
will display a hierarchal view of all the classes. There are a lot of them.这是一张解释 NSObject 类引用的图表,但它不是那个。关于 NSObject 有很多东西需要了解。另一方面,它不是有限的,意味着您也可以添加自定义类。
希望这有帮助。
谢谢。
Here is a diagram explaining about NSObject class references but its not the one. There are so many things to know about NSObject. On the other hand its not finite, means you can add your custom classes also.
Hope this helped.
Thanks.
您可以使用 Xcode
您可以使用
Filter
字段或Navigate ->在符号导航器中显示
。有时Filter
字段存在错误,这就是您应该重复操作的原因You can use Xcode
You can use
Filter
field orNavigate -> Reveal in Symbol Navigator
. SometimesFilter
field is buggy that is why you should repeat actions