Main stack custom property
Posted: Fri Jun 04, 2010 6:24 pm
I have a strange situation going on with a custom property of my app's main stack.
I use a custom property named dbFile in the main stack of my app to store the file path to the sqlite database used by my app. At start up I use it's contents to open the database.
I have an Open option on my apps File menu which presents the user with a file open dialog so they can open a different database. After they select the new database and I successfully open it, I store the file path to the database into the dbFile custom property of my main stack (and save the main stack) so that next time they run the app, it will use the last database they chose. I can see from the Inspector for the main stack that the custom property is updated correctly.
This all works perfectly in the development environment but fails miserably in a standalone application. The standalone opens the correct database at startup and when I open a different database, it opens that correctly and I can see from answer information statements in my code that the dbFile custom property of the main stack is set correctly (the anser comes after I set the dbFile custom property and save the stack). However, if I exit the standalone and run it again, it opens the original database, not the one chosen by the user with the File menu Open option. It's as if the dbFile custom property of the main stack was not saved, even though I can see that it was from my answer statements (plus it works fine in the development environment).
Either I'm missing something obvious or there is something weird about making changes to custom properties of the main stack in a standalone app.
Any ideas?
Pete
I use a custom property named dbFile in the main stack of my app to store the file path to the sqlite database used by my app. At start up I use it's contents to open the database.
I have an Open option on my apps File menu which presents the user with a file open dialog so they can open a different database. After they select the new database and I successfully open it, I store the file path to the database into the dbFile custom property of my main stack (and save the main stack) so that next time they run the app, it will use the last database they chose. I can see from the Inspector for the main stack that the custom property is updated correctly.
This all works perfectly in the development environment but fails miserably in a standalone application. The standalone opens the correct database at startup and when I open a different database, it opens that correctly and I can see from answer information statements in my code that the dbFile custom property of the main stack is set correctly (the anser comes after I set the dbFile custom property and save the stack). However, if I exit the standalone and run it again, it opens the original database, not the one chosen by the user with the File menu Open option. It's as if the dbFile custom property of the main stack was not saved, even though I can see that it was from my answer statements (plus it works fine in the development environment).
Either I'm missing something obvious or there is something weird about making changes to custom properties of the main stack in a standalone app.
Any ideas?
Pete