属性 的 class 属性是什么意思?
What does the class attribute of property mean?
当我查看 Objective-C 的 header NSObject.h 时,我发现一些代码如下,但我找不到 class 的含义属性.
的属性
@protocol NSSecureCoding <NSCoding>
@required
// This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES.
// The Secure Coding Guide should be consulted when writing methods that decode data.
@property (class, readonly) BOOL supportsSecureCoding;
@end
class 属性是什么意思?
class
属性用于声明class属性。 class 属性 由 class 的所有实例共享,不像 实例 属性 每个实例都有自己的副本。 Class 属性在 Xcode 8 中引入,与实例属性不同,它们永远不会被合成,程序员必须编写 getter 和 setter.
有关详细信息,请参阅 this question and answer。
当我查看 Objective-C 的 header NSObject.h 时,我发现一些代码如下,但我找不到 class 的含义属性.
的属性@protocol NSSecureCoding <NSCoding>
@required
// This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES.
// The Secure Coding Guide should be consulted when writing methods that decode data.
@property (class, readonly) BOOL supportsSecureCoding;
@end
class 属性是什么意思?
class
属性用于声明class属性。 class 属性 由 class 的所有实例共享,不像 实例 属性 每个实例都有自己的副本。 Class 属性在 Xcode 8 中引入,与实例属性不同,它们永远不会被合成,程序员必须编写 getter 和 setter.
有关详细信息,请参阅 this question and answer。