Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5494] iOS: userDefaults not remembering the properties that were set

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-23T15:51:06.000+0000
Affected Version/sRelease 1.7.4, Release 1.8.0
Fix Version/sRelease 1.7.5, Release 1.8.0
ComponentsiOS
Labelsmodule_app_properties, qe-testadded
ReporterSabil Rahim
AssigneeSabil Rahim
Created2011-10-11T11:58:59.000+0000
Updated2014-06-19T12:44:01.000+0000

Description

Caused due to the feature implemented by timob-4696 Run the following code in simulator. Comment out the setstring line and re run again ... //app.js var win = Titanium.UI.createWindow({ title:'TEST', backgroundColor:'#fff' }); //Comment out the setString for the second run of the app, //hasProperty will return false for that execution Titanium.App.Properties.setString('my_prop', 'dadfcool'); // <--- comment this line after the first run. Ti.API.info('has property: ' + Ti.App.Properties.hasProperty('my_prop')); var a = Titanium.UI.createAlertDialog({ title:'Test Result', message:'has property: ' + Ti.App.Properties.hasProperty('my_prop'), }); a.show(); //For debugging, list all properties & values var props = Titanium.App.Properties.listProperties(); for (var c = 0; c < props.length; c++) { var value = Titanium.App.Properties.getString(props[c]); Titanium.API.info(props[c] + " = " + value); } win.open(); Result : returns value false Expected :return value true

Comments

  1. Sabil Rahim 2011-10-11

    comment pull pending #548
  2. Reggie Seagraves 2011-10-31

    Should have been labeled merge-1.7.4
  3. Sabil Rahim 2011-10-31

    pull pending #608
  4. Thomas Huelbert 2011-11-02

    regressed against 1.7.5 Nov 1 2011 11:46 rbd9a4c74, 10.6.8, and lion. xcode 4.2 and 4.0, ios5 and ios 4.3. Keeping open till its regressed against master.
  5. Natalie Huynh 2011-11-14

    Tested with 1.8.0.1.v20111114102656 on iPad 2 (4.3.5) iPod Touch (4.0.2) iPhone 4s (5.0) Xoom 3.2.1
  6. Michael Pettiford 2012-01-23

    Reopening issue Tested this issue with Ti Studio build 1.0.8.201201210622 Ti Mob SDK 1.8.1.v20120123130147 OSX Lion 10.7.2 iPhone 3GS OS 4.3 Using the steps provided the second run returns false and not true like expected
  7. Michael Pettiford 2012-01-23

    Closing issue Tested with updated test steps and issue does not occur with same environment as I listed when I reopened this issue.
  8. Neeraj Gupta 2012-01-23

    Reopening this bug to fix "Fix Version" field.

JSON Source