- Inherits from:
- NSCoder : NSObject
- Package:
- com.apple.yellow.foundation
NSUnarchiver, a concrete subclass of NSCoder, defines methods for decoding a set of objects from an archive. Such archives are produced by objects of the NSArchiver class. See the NSCoder and NSArchiver specifications for an introduction to archiving.
While unarchiving, NSUnarchiver performs a variety of consistency checks on the incoming data stream. NSUnarchiver throws an InconsistentArchiveException when:
For a description of type codes, see the discussion of the @encode() compiler directive in Object-Oriented Programming and the Objective-C Language.
Invoking inappropriate methods can also lead to errors. NSUnarchiver's superclass, NSCoder, provides methods for both encoding and decoding. However, only the decoding methods are applicable to NSUnarchiver; don't send an NSUnarchiver any encode... messages.
- Constructors
- NSUnarchiver
- Decoding objects
- decodeByte
- decodeChar
- decodeDataObject
- decodeDouble
- decodeFloat
- decodeInt
- decodeLong
- decodeObject
- decodeShort
- unarchiveObjectWithData
- unarchiveObjectWithFile
- Encoding objects
- encodeByte
- encodeChar
- encodeDataObject
- encodeDouble
- encodeFloat
- encodeInt
- encodeLong
- encodeObject
- encodeShort
- Managing an NSUnarchiver
- isAtEnd
- versionForClassName
- Substituting classes or objects
- classNameDecodedForArchiveClassName
- decodeClassNameAsClassName
- classNameDecodedForArchiveClassName
- decodeClassNameAsClassName
- replaceObject
public NSUnarchiver()
public NSUnarchiver(NSData aData)
public static String classNameGloballyDecodedForArchiveClassName(String nameInArchive)
Note that individual instances of NSUnarchiver can each be given their own class name mappings by invoking the instance method decodeClassNameAsClassName. The NSUnarchiver class has no information about these instance-specific mappings, however, so they don't affect the return value of classNameGloballyDecodedForArchiveClassName.
See Also: classNameDecodedForArchiveClassName
public static void globallyDecodeClassNameAsClassName(
String nameInArchive,
String trueName)
See Also: classNameGloballyDecodedForArchiveClassName, decodeClassNameAsClassName
public static Object unarchiveObjectWithData(NSData data)
See Also: encodeRootObject (NSArchiver)
public static Object unarchiveObjectWithFile(String path)
public String classNameDecodedForArchiveClassName(String nameInArchive)
See Also: classNameGloballyDecodedForArchiveClassName
public NSData data()
public byte decodeByte()
public char decodeChar()
public void decodeClassNameAsClassName(
String nameInArchive,
String trueName)
See Also: classNameDecodedForArchiveClassName, globallyDecodeClassNameAsClassName
public NSData decodeDataObject()
public double decodeDouble()
public float decodeFloat()
public int decodeInt()
public long decodeLong()
public Object decodeObject()
public short decodeShort()
public void encodeByte(byte aByte)
public void encodeChar(char aChar)
public void encodeDataObject(NSData aData)
public void encodeDouble(double aDouble)
public void encodeFloat(float aFloat)
public void encodeInt(int anInt)
public void encodeLong(long aLong)
public void encodeObject(Object anObject)
public void encodeShort(short aShort)
public boolean isAtEnd()
public void replaceObject(
Object object,
Object newObject)
public int versionForClassName(String aString)