Titanium Community Questions & Answer Archive

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

Is it possible to persist objects between sessions?

I want to persist a list of objects between sessions. When I used Titanium.App.Properties.getList / setList I can set store an array of my own object during a session, but not in between. Storing integers works fine.
Maybe I'm creating the objects wrong? Or maybe storing objects just isn't possible?

Thanks
James

— asked May 11th 2010 by James Sugrue
  • iphone
0 Comments

4 Answers

  • i use getList/setList to persist my objects between sessions. Sometimes when i restart the emulator it forgets - but works fine when running on the device.
    also Try - without closing the emulator - quit the app and then restarting the app.

    — answered May 11th 2010 by Stephen Priestley
    permalink
    0 Comments
  • why don't you serialize the objects using JSON.stringify()?

    — answered May 11th 2010 by Damien Elmes
    permalink
    1 Comment
    • I assume when working with a list of objects this can get a little bit confusing? Just guessing…

      — commented November 11th 2010 by Czar
  • I will give this a go - thanks for the suggestion

    — answered May 11th 2010 by James Sugrue
    permalink
    0 Comments
  • edit: sorry, double post when reloading the page to see if there were any updates

    — answered May 11th 2010 by Damien Elmes
    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.