Hi guys,
I’ve started testing an application written in Xojo for Windows on the OS X platform, and are hitting the first hurdle. On Windows I create a folder for my application’s data using the SpecialFolder.SharedApplicationData as follow:
DataFolder = SpecialFolder.SharedApplicationData
if not DataFolder.Child("Zoclee").Exists then
DataFolder.Child("Zoclee").CreateAsFolder
end if
DataFolder = DataFolder.Child("Zoclee")
if not DataFolder.Child("SmartData").Exists then
DataFolder.Child("SmartData").CreateAsFolder
end if
This code runs fine on Windows, however I’m getting an NilObjectException on the following line:
if not DataFolder.Child("SmartData").Exists then
So my question is, what is the best practice on OS X when it comes to storing data created during runtime by an application. Is the SpecFolder.SharedApplicationData the right place to do so? and if so, why can’t I create a folder in it?
FWIW, when I debug the app, the native path of SpecialFolder.SharedApplicationData is
/Library/Application Support
Any pointers or tips that will set me on the right path when it comes to storing application data on OS X will be appreciated.