SaveFileDialog

Same result on 2019r3.2 ??

Run
Command S (notice that you can’t press enter for Save to happen)
Click Save
Shift Command S
Change the name to Untitled1.bizwiz
Click Save
Freeze

It only freezes if you change the name.
Actually if you change the name field on the first attempt to save it freezes also ??

Restart computer
Use Xojo 3.2
Build test project… freeze but if you navigate to a new location or even alternate saving between Desktop and Documents it behaves properly each time even if you change the name.

I could not make your sample project to crash (Mojave).
What I did:
Clicked on the “OK” button. The save dialog appeared.
I renamed to “Untitled2” with the extension. Saved working. Subsequent presses on the push button saved immediately.
Then, I choose “Save As”. The dialog showed and I tried “Untitled3”. No crash, no hang.

Actually, if no one else is having the same problem and can’t reproduce it (even with your sample project), I’d be tempted to think something’s wrong on your computer (e.g. try to rebuild the desktop database, check for corrupted preferences files, etc.).

Or, can you tell exactly the steps to make the crash, if they aren’t the same as the ones I tried?

Does the debugger not catch these exceptions? (I have never experimented how this chain works).
If yes, what about the Xojo debugger? Does it intercept NSExceptions?

I seem to recall, with MBS, the NSExceptions break the app, but I’m not sure if it’s the plugin that gets the exception and triggers a “new one” for Xojo, with the Exception of the framework.

Of course, regular users don’t have a debugger, but once you get aware of the new behaviour, I’d be tempted to think it’s still viewable. :thinking:

Can you test a compiled version of the app as I moved that to another computer and it exits with a nilobjectexception error.
Run
Command S or click ok
Click Save (don’t change the name)
Shift Command S
Change the name to Untitled1.bizwiz
Click Save
crash

Tested on Catalina 10.15.5, Catalina 10.15.6 and High Sierra 10.13.6 on iMac and MacBook Pro
Did @anon20074439 say he also say the bug?

Sadly it doesn’t, as I don’t think Apple raises them to a place where Xojo can collect them.

Right okay, so I was thinking about this and I recalled something that @Tim_Parnell had mentioned recently about initial directory being broken, which made me recall that when I was writing my own save dialog class, I also experienced issues when trying to make Save dialogs “restore” locations.

So if you disable the initial directory code, does it help?

Took out setting initialfolder and it defaults to documents but didn’t make any difference.
Can someone provide alternative code please? or sample project

Looking at the code again, there’s two things that pop-out today.

  1. “dlg.InitialFolder = savefile” should be “dlg.InitialFolder = savefile.parent”, but it doesn’t make any difference. You’re passing a file when it should be a folder.
  2. I don’t see where you are setting the dialog.filter for the filetype, I wonder if this is causing a problem.

Lastly, macOS stores a whole bunch of settings for dialogs in the apps preferences. I wonder if there’s a corrupted value in there.

“defaults remove au.com.rushsoftware.savetest” in the Terminal (while the application isn’t running) should flush all the preferences.

1 Like

This has definitely helped Sam.
Has anyone else experienced problems running projects from Dropbox?

1 Like

Network drives or dropbox always give weird issues

3 Likes

I had this problem in a project I was working on.
This problem does not always occur.
Sometimes it doesn’t happen without modifying the project.
It may not occur even if you try it many times.
When it occurs, it occurs continuously.
I stopped using SaveFileDialog, wrote an alternative code and the problem no longer occurs.

sorry.
I am not good at English so it may be difficult to understand.

Thanks for confirming Ichiro, I put it down to me incorrectly applying the structure and corrupting the App preferences. I had it happen in 2 projects but now working properly.

Hi
I’m suddenly getting this problem.
My program has two instances of SaveFileDialog, one was saving an XML file and it worked, wrote that several weeks ago. Can’t remember if it was before or after updating to Xojo2020 1.2 but it was definitely before the last macOS update.
I’m now trying to implement a New Database option and the SaveFileDialog is freezing as described in the conversation above. Now the XML save is freezing as well.
I still have the original source of the program which is API 1 and it is running fine, even if recompiled.
The solution to type
defaults remove au.com.rushsoftware.savetest
into terminal didn’t work. Actually terminal didn’t like it, said domain not found.
Can anyone suggest anything please.

Jack

Replace “au.com.rushsoftware.savetest” with the identifier of your application and try again.

That’s got it, thanks.

Jack

1 Like

This issue has come back again and this time the DEFAULTS REMOVE solution doesn’t appear to work. This is a real showstopper. I could write my own but that seems a ridiculous step to take.
Anyone got any ideas.
Thanks

Jack

More info. I built the application with what I had available (the app’s not complete) which included my export function … the problem occurs in the built application as well, it’s not just an IDE issue.

I left it because DEFAULTS REMOVE didn’t solve it.
But lately this problem has disappeared.
The only things I’ve done recently are removing my app with App Cleaner and performing maintenance with Onyx.
It may just happen that the problem isn’t occurring.