Thursday, May 2, 2013

NSKeyedArchiver encodeInt64 example ios


encodeInt64 :forKey:

Encodes a given 64-bit integer value and associates it with a given key.
- (void)encodeInt64:(int64_t)intv forKey:(NSString *)key
Parameters of [NSKeyedArchiver encodeInt64]
intv
The value to encode.
key
The key with which to associate intv. This value must not be nil.
Example of [NSKeyedArchiver encodeInt64]
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject: self.fileName forKey: @"fileName"];
    [aCoder encodeInt64: self.fileType forKey:@"fileType"];
    [aCoder encodeInt64: self.totalPackets forKey:@"totalPackets"];
    [aCoder encodeInt64: self.packetIndex forKey:@"packetIndex"];
    [aCoder encodeObject: self.packetContents forKey:@"totalPackets"];
}