Where is it?

I am in the middle of a major stuffup with my latest update. People updating no longer have their purchase recognised but I think it is only the older users from when I transitioned from a single purchase to 2 IAP. As part of that process to protect the older users I checked for a file that would have been created.

f = SpecialFolder.Preferences.child(“Myfile”)

On Sonoma 14 I can’t find that file Xojo says it should be Users\user\AppData\Roaming\ but I can’t see that on my laptop. The file is created when I step through the debugger but I can’t find it when searching??

This might not directly help you, but since macOS 10.9 Apple have been advising developers to NOT directly access the Preferences folder, instead to use Apple provided API to store preferences data. Something that I’d been asking Xojo for years, especially considering they support the Window Registry.

Or store the data in the User’s Application Support folder.

I don’t have Xojo on this Mac, but might it be UserPreferences as there are use prefs locations and system prefs locations.

1 Like

Yes it is here, maybe I was misreading the Xojo docs
/Users/user/Library/Preferences/myfile

This is SpecialFolder.ApplicationData under Windows.

Under MacOS it’s /Users/UserName/Library/Application Support.

In my experience SpecialFolder.ApplicationData is the most robust place to put stuff.

1 Like

Yes.


SpecialFolder.Preferences

Windows: \Users\UserName\AppData\Roaming\

macOS: /Users/UserName/Library/Preferences - use SpecialFolder.ApplicationData to save your own files or directly call CFPreferences to save preferences files here.

Linux: /home/UserName/


But I find the explanation a bit confusing

1 Like

BTW: I have a really old feature request for Preferences, you can add your vote to it if you want.

I hope that when/if Xojo add native macOS Preferences support they pay attention to other languages. Swift’s AppStorage attribute when declaring the property makes life so much easier.

@AppStorage( "PrepareWebPageView_notaryButtonCode" ) var notaryButtonCode: String = "Default Text"

The property then behaves like any other property. Except it auto saves and restores values as needed.

2 Likes