11-19-2013 05:27 AM - edited 11-20-2013 05:09 AM
Are you using the cleaner implementation that Nate posted here:
Whether you are or not, you can not just paste that code into your application and use it. You have to create a key for the PersistentStore Object first - that gives you the Hashtable. Then you have to use a key on the Hashtable to get the actual values you are persisting. So you can't be using the code supplied, you must have tailored it in some way.
I am getting the impression that you are not sure how to use PersistentStore. I recommend that you review the KB articles and documentation that is available, including these:
Having reviewed these, I recommend you revisit the example you have found, and see if you understand what it is actually doing.
I don't use exactly the same approach as suggested by Nate, but it is very similar to it. The important aspects are:
1) access to the persisted data is managed through one class,
2) the persisted data is managed in a collection rather than a single item, and
3) any class wanting to access some data that is persisted identifies the persisted data it wants by specifying a 'lookup' key.