Titanium Appcelerator Quickie: Adding Contacts - Clearly Innovative | Web and Mobile DevelopmentClearly Innovative | Web and Mobile Development

Only Works on iOS at this time, not supported on Android


I wasn’t going to post this, but then I looked through the KitchenSink Examples and did not see the minor detail explained clearly.

When adding address information on contacts, you need to do this wierd map array thingie to get it all to work.

Looking down at the bottom of the Titanium.Contacts.Person Documentation there is a note explaining this behavior


There are two kinds of properties: single value and multivalue. Single value properties are returned as a direct value, while mutlivalue properties are returned as dictionary objects with keys which represent labels of the property, with values that are arrays of all values in the property which correspond to that label (e.g. {“home” : [address1, address2]})

That wasn’t too clear to me, I had to fiddle around to get it… Hope this is helpful to you too!

Screen Shot with data displayed in simulator