Skip to content

Instantly share code, notes, and snippets.

@devluis
Created June 9, 2014 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devluis/0a71fd7f4a8905eed861 to your computer and use it in GitHub Desktop.
Save devluis/0a71fd7f4a8905eed861 to your computer and use it in GitHub Desktop.
Titanium - Ti.App.Properties
/*
* The App Properties module is used for storing application-related data in property/value pairs that persist beyond application sessions and device power cycles.
*/
// Set property
Ti.App.Properties.setString('myCustomProperty',JSON.stringify('This value is store'));
// Get property
Ti.App.Properties.getString('myCustomProperty');
// Remove property
Ti.App.Properties.removeProperty('faceUserName');
// List all properties
var props = Ti.App.Properties.listProperties();
for (var i=0, ilen=props.length; i<ilen; i++){
var value = Ti.App.Properties.getString(props[i]);
Ti.API.info('Despues: ' + props[i] + ' = ' + value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment