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

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

getText:

Get the element for the provided key as a UTF-8 String (use with strings > 32KB, up 2GB) Requires API 1.7.x or higher

- (NSString *)getText:(NSString *)key

Discussion

Get the element for the provided key as a UTF-8 String (use with strings > 32KB, up 2GB) Requires API 1.7.x or higher

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 (use with strings <= 32KB)

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

Discussion

Get the element for the provided key as a UTF-8 String (use with strings <= 32KB)

Declared In

SFSObject.h

getUtfStringArray:

Get the element for the provided key as an array of UTF-8 Strings (use with strings <= 32KBytes)

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

Discussion

Get the element for the provided key as an array of UTF-8 Strings (use with strings <= 32KBytes)

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:

Put a Boolean value with the provided key

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

Discussion

Put a Boolean value with the provided key

Declared In

SFSObject.h

putBoolArray:value:

Put an array of Booleans with the provided key

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

Discussion

Put an array of Booleans with the provided key

Declared In

SFSObject.h

putByte:value:

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

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

Discussion

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

Declared In

SFSObject.h

putByteArray:value:

Put an array of bytes with the provided key

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

Discussion

Put an array of bytes with the provided key

Declared In

SFSObject.h

putDouble:value:

Put a double (64 bit) with the provided key

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

Discussion

Put a double (64 bit) with the provided key

Declared In

SFSObject.h

putDoubleArray:value:

Put an array of doubles with the provided key

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

Discussion

Put an array of doubles with the provided key

Declared In

SFSObject.h

putFloat:value:

Put a float (32 bit) with the provided key

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

Discussion

Put a float (32 bit) with the provided key

Declared In

SFSObject.h

putFloatArray:value:

Put an array of floats with the provided key

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

Discussion

Put an array of floats with the provided key

Declared In

SFSObject.h

putInt:value:

Put an int (32 bit) with the provided key

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

Discussion

Put an int (32 bit) with the provided key

Declared In

SFSObject.h

putIntArray:value:

Put an array of ints with the provided key

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

Discussion

Put an array of ints with the provided key

Declared In

SFSObject.h

putLong:value:

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

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

Discussion

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

Declared In

SFSObject.h

putLongArray:value:

Put an array of long ints with the provided key

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

Discussion

Put an array of long ints with the provided key

Declared In

SFSObject.h

putSFSArray:value:

Put an SFSArray with the provided key

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

Discussion

Put an SFSArray with the provided key

See Also

Declared In

SFSObject.h

putSFSObject:value:

Put an SFSObject with the provided key

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

Discussion

Put an SFSObject with the provided key

Declared In

SFSObject.h

putShort:value:

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

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

Discussion

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

Declared In

SFSObject.h

putShortArray:value:

Put an array of short ints with the provided key

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

Discussion

Put an array of short ints with the provided key

Declared In

SFSObject.h

putText:value:

Put an array of Strings with the provided key (use with strings > 32KB, up to 2GB) Requires API 1.7.x or higher

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

Discussion

Put an array of Strings with the provided key (use with strings > 32KB, up to 2GB) Requires API 1.7.x or higher

Declared In

SFSObject.h

putUtfString:value:

Put a UTF-8 String with the provided key

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

Discussion

Put a UTF-8 String with the provided key

Declared In

SFSObject.h

putUtfStringArray:value:

Put an array of Strings with the provided key (use with strings <= 32KB)

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

Discussion

Put an array of Strings with the provided key (use with strings <= 32KB)

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