Iterate through only set properties
I see an example of iterating through properties here: http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.App.Properties-module
But there's is there a way to identify ONLY the ones that were set via my app? The Ti PROPERTIES have a lot of other properties that were not stored by me…would be great if I could iterate on top of them.
Any ideas?
3 Answers
-
I use only one property for my settings saved as a json string.
Here is a tutorial -
Yeh I've seen this and actually have it open. I think I'm going to switch the way I envisioned this working since there's no way of iterating of properties. Do what you suggest and store all data in an array which will be inside one property list. That sound logical?
-
What do you mean by iterating ? for the object you store you mean ?
Does this help ?var the_obj = {a:'aa', b:'bb', c:'cc'}; function each(obj, fn ) { for( var i in obj ) { fn(obj[i]); } } each( the_obj, function( item ) { Titanium.API.info( item); })