Update 2017
Xcode 8 introduced the properties of the Objective-C class, from the release notes:
Objective-C , Swift. @property (class) NSString *someStringProperty; .
, :
@interface PlayerMenuController : NSObject
@property (class) int idGen;
@end
, , . , , , copy, .
, , Objective-C - .
...
@property , , , ( Xcode 4.6.1, "", , , , ) , , @property.
:
@interface PlayerMenuController : NSObject
+ (int) idGen;
+ (void) setIdGen:(int)value;
@end
:
@implementation PlayerMenuController
static int idGen = 0;
+ (int) idGen { return idGen; }
+ (void) setIdGen:(int)value { idGen = value; }
@end
:
NSLog(@"initial value: %d", PlayerMenuController.idGen);
PlayerMenuController.idGen = 42;
NSLog(@"updated value: %d", PlayerMenuController.idGen);
:
initial value: 0
updated value: 42
, " " - , , ; -)