AGEncoder Protocol Reference
Conforms to | NSObject |
Declared in | AGEncoder.h |
Overview
Provides a common interface around NSPropertyListSerialization and NSJSONSerialization plist output formats. See AGPListEncoder class for plist encoding and AGJsonEncoder class for JSON encoding.
Instance Methods
decode:error:
Creates and returns a property list from the specified data.
- (id)decode:(NSData *)data error:(NSError **)error
Parameters
- data
A collection (e.g. NSArray) which is being persisted.
- error
An error object containing details of why the decode failed.
Return Value
A property list object corresponding to the representation in data. If data is not in a supported format, returns nil.
Discussion
Creates and returns a property list from the specified data.
Declared In
AGEncoder.h
encode:error:
Returns an NSData object containing a given property list encoded in the respective serialization format.
- (NSData *)encode:(id)plist error:(NSError **)error
Parameters
- plist
A valid property list object to be encoded.
- error
An error object containing details of why the encode failed.
Return Value
An NSData object containing plist encoded in the respective serialization format.
Discussion
Returns an NSData object containing a given property list encoded in the respective serialization format.
Declared In
AGEncoder.h
isValid:
Returns a Boolean value that indicates whether a given property list is valid for a given serialization format.
- (BOOL)isValid:(id)plist
Parameters
- plist
A property list object.
Return Value
YES if plist is a valid property list in format format, otherwise NO.
Discussion
Returns a Boolean value that indicates whether a given property list is valid for a given serialization format.
Declared In
AGEncoder.h