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!
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.
-
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 if(appversion!=110){ do something } Ti.App.Properties.setInt("appversion",110); Ti.API.info('2nd check version='+appversion) //check