You never substantiate store, you just declare it. It's not a datatype so it needs to be substantiated- you've only created a singleton
Code:
private Store store; //singleton
.......
//elsewhere
private someFxn()
{
store = new Store();
// now store is usable
}
which let's you do things like
Code:
private Store store;
.....
private someFxn()
{
for(int i=0; i<10; i++)
{
store = new Store();
using (store)
{
/// do something
}
}
}
without throwing an error (note idk what the java equivalent is to using in C#)
because if you did this
Code:
private Store store = new store();
.....
private someFxn()
{
for(int i=0; i<10; i++)
{
using (store)
{
/// do something
}
}
}
it would go through the loop once, destroy it and then throw a null exception