Skip to content

Standard type mappings

jeremieweldin edited this page Oct 18, 2011 · 8 revisions

Basic types

ActionScript Objective-C Notes
null, undefined NSNull
String NSString
Boolean NSNumber NSNumber containing a Bool value converts to a Boolean
Number NSNumber NSNumber containing a numeric value converts to a Number
Date NSDate
XML NSString
Array NSArray
Object NSDictionary
RecordSet not supported

AMF3

ActionScript Objective-C
int, uint NSNumber
ByteArray NSData

Flex

ActionScript Objective-C
ObjectProxy FlexObjectProxy
ArrayCollection FlexArrayCollection
AbstractMessage FlexAbstractMessage
AcknowledgeMessage FlexAcknowledgeMessage
CommandMessage FlexCommandMessage
ErrorMessage FlexErrorMessage
RemotingMessage FlexRemotingMessage
DataMessage not supported
SequencedMessage not supported
PagedMessage not supported
DataErrorMessage not supported

Niceties

There are three options to improve handling of ArrayCollections and ObjectProxies.
By setting

[AMFUnarchiver setOptions:(AMFUnarchiverUnpackArrayCollection | AMFUnarchiverUnpackObjectProxyOption)];

ArrayCollections will automatically be deserialized to ordinary NSArrays and ObjectProxies to NSDictionaries.

You can also set

[AMFArchiver setOptions:AMFArchiverPackArrayOption];

in order to serialize NSArrays into ArrayCollections.
Clone this wiki locally