Inherits from: NSCoder : NSObject
Package: com.apple.yellow.foundation
NSUnarchiver, a concrete subclass of NSCoder, defines methods for decoding a set of Objective-C 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 exception 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.
- Decoding objects
- unarchiveObjectWithData
- unarchiveObjectWithFile
- Managing an NSUnarchiver
- isAtEnd
- objectZone
- setObjectZone:
- systemVersion
- Substituting classes or objects
- classNameDecodedForArchiveClassName
- decodeClassNameAsClassName
- classNameDecodedForArchiveClassName
- decodeClassNameAsClassName
- replaceObject
public NSUnarchiver()
public NSUnarchiver(NSData aNSData)
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 aString, String aString)
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)
Note that there's also a class method of the same name. The class method has precedence in case of conflicts.
See Also: decodeClassName:asClassName:classNameDecodedForArchiveClassName
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 aNSData)
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)