This class is throwing an NSInternalInconsistencyException immediately after my app delegate gets an ApplicationWillResignActive message as shown below. This happens only on 15.2.
In the Event processing run loop in my NSApplication subclass, I added a couple of lines to monitor the value of "mainWindow" as defined in NSApplication. It contains a valid window pointer until after the ApplicationWillResignActive message. FYI I do not appear to ever get a ApplicationDidResignActive call.
My questions:
What is NSUIActivityDocumentMonitor and what exactly does it do? I can find no documentation on it at all. Should I assume it is created by NSDocument? Can or should I prevent its creation?
The error text implies that my NSApplication subclass is not sending out a notification when its "mainWindow" property changes (in my case it appears to get changed to nil as a result of resigning the active state). That has never been an issue before now.
This does not occur on ANY other prior macOS releases including 15.1. How can I prevent this error that is being thrown by a previously unknown class? Are there new recommended actions I should take when I get the ApplicationWillResignActive call? Wouldn't NSApplication/NSObject handle the KVO compliance issue (notify observers of a change to "mainWindow")?
FYI, this only happens when I have an opened document window (either new or opened from the desktop).
If I ignore the error in my run loop, the app continues normally in the background and can be brought back to be the front app no problem.
I'm at my wits end trying to get rid of this (properly instead of ignoring the error) and could use some guidance. This is a mature app in use by many clients. Objective C.
Post
Replies
Boosts
Views
Activity
My app is the client in a client-server document management system. It supports scanning, indexing, and creation of various types documents including PDF, TIFF, various image types, and text. Upon installation of macOS 15.2, I am getting a strange NSInternalInconsistencyException error so long as the following are true:
I have created or opened a PDF (or other type) document
I click on the desktop/Finder or other app
Normally, I would expect this action to put my App in the background, but before that happens, the error is thrown. I am not connected any server at the time. My app is built catch unhandled exceptions and this is what is displayed:
At the time the error is thrown, [NSApp mainWindow] appears to be set to nil, but I have no idea if this occurred as result of becoming the background app or because of something I am doing wrong. I never set mainWindow anywhere in my app. I've tried to set a Waitchpoint or various waist try and catch when mainWindow changes, but have come up empty. Note the error is thrown if I hit a breakpoint when debugging in Xcode (because it switches to Xcode).
This errors never occurred with previous releases and does not occur when the app is run under 15.1. The app is written in ObjectiveC.
I've looked at various app-level flags and info.plist properties and nothing I've seen jumps out at me. I strongly suspect this error is a result of some system-level app attempting to create a UserActivity file (perhaps encrypted) that it can store in the cloud (a feature we would rather not use yet). It could also be trying to do an autosave on my open document-based windows - our NIB files that apply to our documents are marked as Restorable and they worked in prior system releases. Turning the Restorable flag off has no effect on the error.
Any clue what I might be missing here? I've spent an embarrassing number of days trying to understand why this is happening.