Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked September 6th 2010 by Rick Blalock
  • properties
0 Comments

3 Answers

  • I use only one property for my settings saved as a json string.
    Here is a tutorial

    — answered September 6th 2010 by Dan Tamas
    permalink
    0 Comments
  • 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?

    — answered September 6th 2010 by Rick Blalock
    permalink
    0 Comments
  • 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);
    })
    
    — answered September 6th 2010 by Dan Tamas
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.