Open panel not opening in Catalina


John Brownie
 

And further, if I remove the __weak qualifier, it works without a breakpoint...

OK, this code is from years ago, and I no longer know why the reference to the open panel had to be weak. It is used inside the completion handler, which might be a clue.

John


Quincey Morris
 

On Nov 18, 2019, at 07:15 , John Brownie <john_brownie@...> wrote:

    __weak NSOpenPanel *openPanel = [NSOpenPanel openPanel];

Why are you declaring this __weak? That means the open panel is subject to *immediate* deallocation, which sounds exactly like the symptoms you’re seeing.


John Brownie
 

A little more investigation reveals that it seems that the key thing is actually setting a breakpoint and stepping over the line:

    __weak NSOpenPanel *openPanel = [NSOpenPanel openPanel];

 in the debugger. If I continue after that line, I get the panel, and otherwise do not, with a silent failure.

I've found a couple of other discussions which seem to say that Catalina (at least beta versions) treated all open panels as sandboxed, even if the app isn't, but I can't see the specific errors that are reported in those discussions (with XPC).

John


John Brownie
 

I have a weird situation where I show an open panel via beginSheetModalForWindow:completionHandler:. The problem is that it works OK with Mojave (and before, I assume), but it doesn't work in Catalina (10.15.1). What's weird is that, if I step through in the debugger, it appears, but if I let it continue through, it doesn't appear. My app is not sandboxed, so it shouldn't be anything to do with that.

Any ideas? I'm stumped at the moment.

John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland