谁能告诉我什么时候我们可以创建一个类而无需子类化 NSObject?
最佳答案
"
NSObject
is the root class of most Objective-C class hierarchies. ThroughNSObject
, objects inherit a basic interface to the runtime system and the ability to behave as Objective-C objects."
正如这所建议的,当代码中引入的类型的实例需要表现得像 Objective-C 对象(或类本身,在某些罕见的情况下)时,您需要为代码中引入的类型创建子类)。
关于swift - Swift 中没有子类化 NSObject 的类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48376669/