NSCoder Class Reference

最終更新:

匿名ユーザー

- view
だれでも歓迎! 編集

トップ> リファレンス > File Management > NSCoder クラスリファレンス

NSCoder クラスリファレンス 翻訳元


このページの最終更新:2010-02-02
ADCの最終更新:2006-07-23


継承するクラス NSObject
準拠しているプロトコル NSObject (NSObject)
フレームワーク /System/Library/Frameworks/Foundation.framework
使用可能な環境 Mac OS X v10.0以降
コンパニオンガイド Archives and Serializations Programming Guide for Cocoa
宣言ファイル NSCoder.h
NSGeometry.h
サンプルコード IBFragmentView
Mountains
Movie Overlay
Reducer
SimpleStickies

概観(Overview)


 NSCoderクラスは、具体クラスがオブジェクトやObjective-Cデータアイテムとメモリや他のデータ型間の変換に使うインターフェースを定義する抽象クラスです。このクラスでは、アーカイブ化(オブジェクトやデータアイテムをディスクにどのようにストアするか)やディストリビューション(オブジェクトやデータアイテムを異なるスレッド間やプロセス間でどうコピーするか)の基礎を提供します。この為にFounationが提供している具体クラスはNSArchiver、NSUnarchiver、 NSKeyedArchiver、 NSKeyedUnarchiver、NSPortCoderです。NSCoderの具体クラスは一般にはコーダクラスとして、インスタンスはコーダオブジェクト(または単なるコーダ)として扱われます。値をエンコードすることしかできないコーダオブジェクトはエンコーダオブジェクト、デコードすることしかできないオブジェクトはデコーダオブジェクトとして利用されます。
 NSCoderはオブジェクト、スカラー、Cの配列、構造体、文字列、またこれらへのポインタを処理します。共用体(union)、汎用ポインタ(void*)、関数ポインタ、多重配列等プラットフォームに依存するデータ型を扱うことはできません。コーダオブジェクトはオブジェクトのデータとともにデータ型もストアするので、バイトストリームからデコードされたオブジェクトは、通常はストリームにエンコードされたもとのオブジェクトと同じクラスのオブジェクトになります。しかしエンコード時にオブジェクトのクラスを変えることもできます。このことは「Archives and Serializations Programming Guide for Cocoa」で解説しています。

このクラスでできること(Tasks)


コーダへの確認(Testing Coder)

   – allowsKeyedCoding
   – containsValueForKey:

データのエンコード(Encoding Data)

   – encodeArrayOfObjCType:count:at:
   – encodeBool:forKey:
   – encodeBycopyObject:
   – encodeByrefObject:
   – encodeBytes:length:
   – encodeBytes:length:forKey:
   – encodeConditionalObject:
   – encodeConditionalObject:forKey:
   – encodeDataObject:
   – encodeDouble:forKey:
   – encodeFloat:forKey:
   – encodeInt:forKey:
   – encodeInteger:forKey:
   – encodeInt32:forKey:
   – encodeInt64:forKey:
   – encodeObject:
   – encodeObject:forKey:
   – encodePoint:
   – encodePoint:forKey:
   – encodePropertyList:
   – encodeRect:
   – encodeRect:forKey:
   – encodeRootObject:
   – encodeSize:
   – encodeSize:forKey:
   – encodeValueOfObjCType:at:
   – encodeValuesOfObjCTypes:
   – encodeNXObject: Deprecated in Mac OS X v10.5

データのデコード(Decoding Data)

   – decodeArrayOfObjCType:count:at:
   – decodeBoolForKey:
   – decodeBytesForKey:returnedLength:
   – decodeBytesWithReturnedLength:
   – decodeDataObject
   – decodeDoubleForKey:
   – decodeFloatForKey:
   – decodeIntForKey:
   – decodeIntegerForKey:
   – decodeInt32ForKey:
   – decodeInt64ForKey:
   – decodeObject
   – decodeObjectForKey:
   – decodePoint
   – decodePointForKey:
   – decodePropertyList
   – decodeRect
   – decodeRectForKey:
   – decodeSize
   – decodeSizeForKey:
   – decodeValueOfObjCType:at:
   – decodeValuesOfObjCTypes:
   – decodeNXObject Deprecated in Mac OS X v10.5

ゾーンの管理(Managing Zones)

   – objectZone
   – setObjectZone:

バージョン情報の取得(Getting Version Information)

   – systemVersion
   – versionForClassName:

インスタンスメソッド





+ タグ編集
  • タグ:
  • Cocoa
  • リファレンス
  • File Management
  • 未完

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

目安箱バナー