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