Inherits from NSObject
Conforms to ISFSObject
Declared in SFSObject.h
SFSObject.m

Overview

SFSObject is used from both server and client sides to exchange data. It can be thought of a specialized Dictionary/Map object that can contain any type of data.

The advantage of using SFSObject is that you can fine tune the way your data will be transmitted over the network. For instance, a number like 100 can be transmitted as a normal integer (which takes 32 bits) but also a short (16 bit) or even a byte (8 bit)

SFSObject supports many primitive data types and related arrays of primitives. It also allows to serialize class instances and rebuild them on the Java side. This is explained in greater detail in a separate document.

See ISFSObject, SFSArray

Tasks

Class Methods

newFromBinaryData:

Alternative static constructor that builds an SFSObject from a valid SFSObject binary representation

+ (id)newFromBinaryData:(NSData *)packet

Discussion

Alternative static constructor that builds an SFSObject from a valid SFSObject binary representation

Declared In

SFSObject.h

newInstance

Alternative static constructor

+ (id)newInstance

Discussion

Alternative static constructor

Declared In

SFSObject.h

Instance Methods

containsKey:

Returns true if an element exists with the provided key

- (BOOL)containsKey:(NSString *)key

Discussion

Returns true if an element exists with the provided key

Declared In

SFSObject.h

getBool:

Get the element for the provided key as a Boolean

- (BOOL)getBool:(NSString *)key

Discussion

Get the element for the provided key as a Boolean

Declared In

SFSObject.h

getBoolArray:

Get the element for the provided key as an array of Booleans

- (NSArray *)getBoolArray:(NSString *)key

Discussion

Get the element for the provided key as an array of Booleans

Declared In

SFSObject.h

getByte:

Get the element for the provided key as a signed byte (8 bit) (int in AS3)

- (NSInteger)getByte:(NSString *)key

Discussion

Get the element for the provided key as a signed byte (8 bit) (int in AS3)

Declared In

SFSObject.h

getByteArray:

Get the element for the provided key as a an array of byte

- (NSData *)getByteArray:(NSString *)key

Discussion

Get the element for the provided key as a an array of byte

Declared In

SFSObject.h

getDouble:

Get the element for the provided key as a double (Number in AS3)

- (NSNumber *)getDouble:(NSString *)key

Discussion

Get the element for the provided key as a double (Number in AS3)

Declared In

SFSObject.h

getDoubleArray:

Get the element for the provided key as an array of doubles

- (NSArray *)getDoubleArray:(NSString *)key

Discussion

Get the element for the provided key as an array of doubles

Declared In

SFSObject.h

getDump:

Return a formatted dump of the object that can logged or traced in the console for debugging purposes.

- (NSString *)getDump:(BOOL)format

Parameters

format

turns the “pretty print” on/off

Discussion

Return a formatted dump of the object that can logged or traced in the console for debugging purposes.

Declared In

SFSObject.h

getFloat:

Get the element for the provided key as a float (Number in AS3)

- (NSNumber *)getFloat:(NSString *)key

Discussion

Get the element for the provided key as a float (Number in AS3)

Declared In

SFSObject.h

getFloatArray:

Get the element for the provided key as an array of floats

- (NSArray *)getFloatArray:(NSString *)key

Discussion

Get the element for the provided key as an array of floats

Declared In

SFSObject.h

getHexDump

Returns a detailed hex-dump of the object that can logged or traced in the console for debugging purposes.

- (NSString *)getHexDump

Discussion

Returns a detailed hex-dump of the object that can logged or traced in the console for debugging purposes.

Declared In

SFSObject.h

getInt:

Get the element for the provided key as an int (32 bit)

- (NSInteger)getInt:(NSString *)key

Discussion

Get the element for the provided key as an int (32 bit)

Declared In

SFSObject.h

getIntArray:

Get the element for the provided key as an array of int

- (NSArray *)getIntArray:(NSString *)key

Discussion

Get the element for the provided key as an array of int

Declared In

SFSObject.h

getKeys

Return an array with all the keys in the SFSObject

- (NSArray *)getKeys

Discussion

Return an array with all the keys in the SFSObject

Declared In

SFSObject.h

getLong:

Get the element for the provided key as a long int (64 bit) (Number in AS3)

- (NSNumber *)getLong:(NSString *)key

Discussion

Get the element for the provided key as a long int (64 bit) (Number in AS3)

Declared In

SFSObject.h

getLongArray:

Get the element for the provided key as an array of long int

- (NSArray *)getLongArray:(NSString *)key

Discussion

Get the element for the provided key as an array of long int

Declared In

SFSObject.h

getSFSArray:

Get the element for the provided key as an SFSArray

- (id<ISFSArray>)getSFSArray:(NSString *)key

Discussion

Get the element for the provided key as an SFSArray

Declared In

SFSObject.h

getSFSObject:

Get the element for the provided key as an SFSObject

- (id<ISFSObject>)getSFSObject:(NSString *)key

Discussion

Get the element for the provided key as an SFSObject

Declared In

SFSObject.h

getShort:

Get the element for the provided key as a short int (16 bit) (int in AS3)

- (NSInteger)getShort:(NSString *)key

Discussion

Get the element for the provided key as a short int (16 bit) (int in AS3)

Declared In

SFSObject.h

getShortArray:

Get the element for the provided key as an array of short int

- (NSArray *)getShortArray:(NSString *)key

Discussion

Get the element for the provided key as an array of short int

Declared In

SFSObject.h

getUnsignedByte:

Get the element for the provided key as a unsigned byte (8 bit) (int in AS3)

- (NSInteger)getUnsignedByte:(NSString *)key

Discussion

Get the element for the provided key as a unsigned byte (8 bit) (int in AS3)

Declared In

SFSObject.h

getUnsignedByteArray:

Get the element for the provided key as a an array of integers representing each byte as unsigned values

- (NSArray *)getUnsignedByteArray:(NSString *)key

Discussion

Get the element for the provided key as a an array of integers representing each byte as unsigned values

Declared In

SFSObject.h

getUtfString:

Get the element for the provided key as a UTF-8 String

- (NSString *)getUtfString:(NSString *)key

Discussion

Get the element for the provided key as a UTF-8 String

Declared In

SFSObject.h

getUtfStringArray:

Get the element for the provided key as an array of UTF-8 Strings

- (NSArray *)getUtfStringArray:(NSString *)key

Discussion

Get the element for the provided key as an array of UTF-8 Strings

Declared In

SFSObject.h

isNull:

Checks if a specific element in the SFSObject is null

- (BOOL)isNull:(NSString *)key

Discussion

Checks if a specific element in the SFSObject is null

Declared In

SFSObject.h

putBool:value:

puts a Boolean value with the provided key

- (void)putBool:(NSString *)key value:(BOOL)value

Discussion

puts a Boolean value with the provided key

Declared In

SFSObject.h

putBoolArray:value:

puts an array of Booleans with the provided key

- (void)putBoolArray:(NSString *)key value:(NSArray *)value

Discussion

puts an array of Booleans with the provided key

Declared In

SFSObject.h

putByte:value:

puts a byte value (8 bit) with the provided key

- (void)putByte:(NSString *)key value:(NSInteger)value

Discussion

puts a byte value (8 bit) with the provided key

Declared In

SFSObject.h

putByteArray:value:

puts an array of bytes with the provided key

- (void)putByteArray:(NSString *)key value:(NSData *)value

Discussion

puts an array of bytes with the provided key

Declared In

SFSObject.h

putDouble:value:

puts a double (64 bit) with the provided key

- (void)putDouble:(NSString *)key value:(NSNumber *)value

Discussion

puts a double (64 bit) with the provided key

Declared In

SFSObject.h

putDoubleArray:value:

puts an array of doubles with the provided key

- (void)putDoubleArray:(NSString *)key value:(NSArray *)value

Discussion

puts an array of doubles with the provided key

Declared In

SFSObject.h

putFloat:value:

puts a float (32 bit) with the provided key

- (void)putFloat:(NSString *)key value:(NSNumber *)value

Discussion

puts a float (32 bit) with the provided key

Declared In

SFSObject.h

putFloatArray:value:

puts an array of floats with the provided key

- (void)putFloatArray:(NSString *)key value:(NSArray *)value

Discussion

puts an array of floats with the provided key

Declared In

SFSObject.h

putInt:value:

puts an int (32 bit) with the provided key

- (void)putInt:(NSString *)key value:(NSInteger)value

Discussion

puts an int (32 bit) with the provided key

Declared In

SFSObject.h

putIntArray:value:

puts an array of ints with the provided key

- (void)putIntArray:(NSString *)key value:(NSArray *)value

Discussion

puts an array of ints with the provided key

Declared In

SFSObject.h

putLong:value:

puts a long int (64 bit) with the provided key

- (void)putLong:(NSString *)key value:(NSNumber *)value

Discussion

puts a long int (64 bit) with the provided key

Declared In

SFSObject.h

putLongArray:value:

puts an array of long ints with the provided key

- (void)putLongArray:(NSString *)key value:(NSArray *)value

Discussion

puts an array of long ints with the provided key

Declared In

SFSObject.h

putSFSArray:value:

puts an SFSArray with the provided key

- (void)putSFSArray:(NSString *)key value:(id<ISFSArray>)value

Discussion

puts an SFSArray with the provided key

See Also

Declared In

SFSObject.h

putSFSObject:value:

puts an SFSObject with the provided key

- (void)putSFSObject:(NSString *)key value:(id<ISFSObject>)value

Discussion

puts an SFSObject with the provided key

Declared In

SFSObject.h

putShort:value:

puts a short int (16 bit) with the provided key

- (void)putShort:(NSString *)key value:(NSInteger)value

Discussion

puts a short int (16 bit) with the provided key

Declared In

SFSObject.h

putShortArray:value:

puts an array of short ints with the provided key

- (void)putShortArray:(NSString *)key value:(NSArray *)value

Discussion

puts an array of short ints with the provided key

Declared In

SFSObject.h

putUtfString:value:

puts a UTF-8 String with the provided key

- (void)putUtfString:(NSString *)key value:(NSString *)value

Discussion

puts a UTF-8 String with the provided key

Declared In

SFSObject.h

putUtfStringArray:value:

puts an array of Strings with the provided key

- (void)putUtfStringArray:(NSString *)key value:(NSArray *)value

Discussion

puts an array of Strings with the provided key

Declared In

SFSObject.h

removeElement:

Removes an element

- (void)removeElement:(NSString *)key

Discussion

Removes an element

Declared In

SFSObject.h

size

Return the number of elements in the SFSObject

- (NSInteger)size

Discussion

Return the number of elements in the SFSObject

Declared In

SFSObject.h

toBinary

Return the binary form of the object

- (NSData *)toBinary

Discussion

Return the binary form of the object

Declared In

SFSObject.h