decodeInt32ForKey:
キーでint32をデコードします
-(int32_t)decodeInt32ForKey:(NSString *)key:
解説
キーでint32をデコードします。
キー付きのアーカイブはNSKeyedArchiverとNSKeyedUnarchiverを使います。
サブクラスで-allowsKeyedCodingをオーバーライドしてYESを返さなければいけません。
返り値
( int32_t )
整数値
引数
( NSString * )key
キー
フレームワーク
Foundation
クラス
NSCoder
Instance Methods
使用可能
10.2
参照
例文
#import "MyView.h" @implementation MyView //アンアーカイブするときの手順の記述 - (id)initWithCoder:(NSCoder *)decoder { NSLog([NSString stringWithFormat:@"%d",[decoder decodeInt32ForKey:@"key"]]); return self; } //アーカイブするときの手順の記述 - (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeInt32:123456 forKey:@"key"]; } @end