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