Titanium Community Questions & Answer Archive

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

Gettings App properties into iPhone Settings App

Right, fed up with banging my head against the wall on this one.

Can someone provide a quick 'How-to' on getting application properties into the iPhone 'Settings' app please? KitchenSink does it, but I can't seem to replicate it at all. The only information I can glean is that you need to append '_preference' to the name of your property, but it still doesn't work for me. I've tried copy/pasting the KitchenSink code:

if (Titanium.Platform.name != 'android')
    Titanium.API.info("AppSetting Name = " + Titanium.App.Properties.getString('name_preference'));
    Titanium.API.info("AppSetting Enabled = " + Titanium.App.Properties.getString('enabled_preference'));
    Titanium.API.info("AppSetting Slider = " + Titanium.App.Properties.getString('slider_preference'));

… but no dice.

Help please!

— asked August 5th 2010 by Andy Smith
  • iphone
  • properties
  • settings

2 Answers

  • Accepted Answer

    You will also need to add and configure the Settings bundle for your project.

    The easiest is probably to copy the Settings.bundle from Kitchen Sink to the modules/iphone folder under your project.

    You might also want to check Apple's Implementing Application Preferences document for more information on preparing your Settings.bundle.

    — answered August 5th 2010 by Goran Skledar
    • Has anyone noticed this doesn't work for 5.1 > anymore? The Kitchensink settings don't appear on my iPhone / iPad, and therefore my apps has disappeared too..

      — commented September 10th 2012 by Mark Henderson
    • I still does work; I've seen it working in iOS6. However, your files now need to be placed in a /platform folder and not /modules as it was prior to Ti1.8. The /modules directory is now used by Titanium for external modules not application settings.

      — commented November 19th 2012 by Darren Cope
  • That's what i did to set app version on app.js, this should get your going on how to set and get setting value.

    var appversion = null;
    appversion = Ti.App.Properties.getInt("appversion");
    Ti.API.info('1st check version='+appversion) //check
       do something
    Ti.API.info('2nd check version='+appversion) //check
    — answered August 5th 2010 by Daniel Lim
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.