Difficult to express original meaning in Chinese
Method and class attributes
Objective-C
Now supports some GCC attributes for objective-C methods.
Syntactically, attributes for a method follow the method's declaration,
And attributes for a method parameter sit between the parameter type and
The parameter name. Supported attributes include:
Deprecation and availability, including availabilitymacros. h
- (void)method:(id)param __attribute__((deprecated)); |
Unused Parameters
- (void)method:(id) __attribute__((unused)) param; |
Sentinel parameters, includingNS_REQUIRES_NIL_TERMINATION
- (void)methodWithObjects:(id)obj, ... NS_REQUIRES_NIL_TERMINATION; |
Objective-C
Also supports some GCC attributes for objective-C classes.
Syntactically, attributes for a class precede the class's@interface
Declaration. Supported attributes include:
@ Package instance variables
@package
Is a new instance variable protection class, like@public
And@protected
.@package
Instance variables behave as follows:
@public
In 32-bit;
@public
In 64-bit, inside the framework that defined the class;
@private
In 64-bit, outside the framework that defined the class.
In 64-bit, the instance variable symbol for@package
Ivar is not exported, so any attempt to use the Ivar from outside
Framework that defined the class will fail with a link error. See "" 64-bit class and instance variable access control"
"For more about instance variable symbols.