+setVersion:
クラスバージョン番号をセットします
+(void)setVersion:(NSInteger)aVersion:
class func setVersion(_ aVersion: Int)
解説
クラスバージョン番号をセットします。
クラスのインスタンスがアーカイブされることになっていて、後で再利用されることになっているとき、バージョン番号を使います。
初期設定は、0。
フレームワーク
Foundation
クラス
NSObject
Class Methods
使用可能
10.0
参照
+ version
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { [MyObject setVersion:1]; NSLog([NSString stringWithFormat:@"%d",[MyObject version]]); } @end