Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-5494

iOS: userDefaults not remembering the properties that were set

    Details

      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

        Attachments

          Activity

            People

            • Assignee:
              srahim Sabil Rahim
              Reporter:
              srahim Sabil Rahim
            • Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-4654
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code