Copy link to clipboard
Copied
Hi folks,
I'm attempting to access the custom settings I created for my app using the Settings.bundle. However, I can't seem to access the .plist from within ActionScript.
I'm using Julian Dolce's iPhoneAppSettings.as ( https://code.google.com/p/as3iphone/source/browse/#svn%2Ftrunk%2FClasses%2Fcom%2Fflashiphonedevelopm...) which uses the following to read in the .plist:
__path = "Library/Preferences/" + NativeApplication.nativeApplication.applicationID + ".plist";
__file = File.userDirectory.resolvePath( __path );
if( __file.exists )
{
readBinary( __file );
}
This consistently fails as __file.exists returns false. After doing some research, I also tried __path = "AppData/Library/Preferences/" + NativeApplication.nativeApplication.applicationID + ".plist"; to no avail.
I successfully created the Settings; when I install my app and go to Settings, I see the Settings page for my app. Using XCode's Devices window, I can verify that the .plist file has been installed and that its name matches NativeApplication.nativeApplication.applicationID + ".plist". I'm wondering if I simply have the wrong path to the .plist file? I know that Julian's code is about 5 years old, so maybe the path to the .plist file has changed? Is there a better way of accessing this file?
TIA,
--Chi-An
Hey, FYI, the original code does work. I was tripped up by a quirk in iOS: the {applicationID}.plist doesn't exist until you go into the Settings app and look at the custom Settings for your app. I must have been testing it in a different order. If you install the app, then go into Settings, and then launch the app, the file does exist. You can verify this by looking at XCode's Device window: track when the .plist shows up in Library/Preferences.
Copy link to clipboard
Copied
Hey, FYI, the original code does work. I was tripped up by a quirk in iOS: the {applicationID}.plist doesn't exist until you go into the Settings app and look at the custom Settings for your app. I must have been testing it in a different order. If you install the app, then go into Settings, and then launch the app, the file does exist. You can verify this by looking at XCode's Device window: track when the .plist shows up in Library/Preferences.