I have some working Objective-C code that displays a WKWebView and allows printing that content. However, it uses the method -[WKWebView printOperationWithPrintInfo:], which the documentation says is deprecated as of macOS 10.15. However, it doesn't say why this method is deprecated, or what the recommended replacement is. The declaration in WKWebView.h does not even indicate that the method is deprecated. But as an alternative, I tried using +[NSPrintOperation printOperationWithView:printInfo]. Doing it that way just prints a blank page. So, should I keep doing it the doubtful way?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I've recently switched from using Xcode 15 under Ventura to using Xcode 26 under Sequoia on an Intel-CPU Mac. This is a macOS project that uses a legacy build location, and the sources are C++ and Objective-C. For every source being compiled, I get a clang warning "no such include directory" for these 4 directories:
$BUILD_DIR/Debug/include
$BUILD_DIR/SBEngineV4.build/Debug/V4 Dual SBEngine.build/DerivedSources-normal/x86_64
$BUILD_DIR/SBEngineV4.build/Debug/V4 Dual SBEngine.build/DerivedSources/x86_64
$BUILD_DIR/SBEngineV4.build/Debug/V4 Dual SBEngine.build/DerivedSources
I can't figure out where it's getting those directories. I added a Run Script build phase that says echo $HEADER_SEARCH_PATHS, and the first path that reports is the $BUILD_DIR/Debug/include path, yet I don't see that when I look at the header search paths in the target build settings.
I tried deleting all the derived data. I tried Xcode 26.0.1 and 26.1 beta 2.
Running Tahoe 26.1 in a virtual machine, I can't sign into my Apple account. There is an error message saying "Could not communicate with the server." Internet access otherwise seems to be working in the VM. I tried both UTM and VirtualBuddy. Is this supposed to work?
Is there any way I can know that another app has gone full screen? Please note that this is not what NSWindowDidEnterFullScreenNotification does, that only works for my own windows.
As for why I need to know: Say you're playing a YouTube video full screen. The video fills up the main display, and if there's a second display, it goes black. Well, mostly. I have a utility app with small status windows that remain on top. I'd like to be polite and hide them in this scenario.
When I try to use custom Core Image filters in the contentFilters property of an NSView, they don't work in Big Sur (as of 11.0.1 beta). They do work in Catalina. Doesn't matter if they're written using Metal or Core Image Kernel Language. I've reported this as a bug, but I'm wondering if there is some trick or workaround.
The System Status page says that the notary service is up, but every time I try it, I get "Failed retrieving request UUID for upload". I tried with 2 apps, and both Xcode 12.5 and 13.0 beta 2.
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Notarization
I have an app that uses NSURLDownload to download some files. I get an SSL error when running on Sierra (macOS 10.12), but it works fine on El Capitan (10.11) and High Sierra (10.13) and later. Safari has no problem downloading the same file on Sierra. Logging the NSError from the download:didFailWithError: delegate method shows:
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7f9620045950>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, NSErrorPeerCertificateChainKey=(
"<cert(0x7f961f14ce00) s: files.frameforge.com i: R3>",
"<cert(0x7f961f12bc00) s: R3 i: ISRG Root X1>",
"<cert(0x7f961f12c400) s: ISRG Root X1 i: DST Root CA X3>"
), NSUnderlyingError=0x7f961e4af1a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x7f961f14ce00) s: files.frameforge.com i: R3>",
"<cert(0x7f961f12bc00) s: R3 i: ISRG Root X1>",
"<cert(0x7f961f12c400) s: ISRG Root X1 i: DST Root CA X3>"
), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x7f9620045950>, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, _kCFStreamErrorCodeKey=-9802}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, NSErrorFailingURLStringKey=https://files.frameforge.com/webgrab/mac/ff4.0-mac-update-list.xml.wgz, NSErrorClientCertificateStateKey=0}
Any idea how I could fix this? Regarding the recovery suggestion "Would you like to connect to the server anyway?", how would I do that, use an http URL?
The functions CFURLGetFSRef and CFURLCreateFromFSRef have deprecation warnings that say "not supported". That confuses me, because when I see "deprecated" I think "it may stop working at some point in the future", and when I see "not supported" I think "it doesn't work now". Which is it?
Anyone have more understanding of how this is supposed to work , beyond the quick help "If enabled, the build system will sandbox user scripts to disallow undeclared input/output dependencies."? When I turned it on, one of my build scripts failed.
Operation not permitted
error: Sandbox: bash(29174) deny(1) file-read-data
In this case, the input path is to a folder (a framework) and the output path is in the build directory. The paths are definitely correct, because the script accesses them as $SCRIPT_INPUT_FILE_0 and $SCRIPT_OUTPUT_FILE_0, so the script wouldn't work at all if I had an error in the paths.
I tried putting a slash at the end of an input path, and then the error was just "operation not permitted", without mentioning the sandbox.
The docs on -[NSString stringWithFormat:] link to old docs on string format specifiers which say that “the %s specifier causes the characters to be interpreted in the system default encoding”. What the heck is the system default encoding? I tried googling it, and all I found was people saying that while a program may have a default encoding, the Mac OS does not.
According to the documentation of the NSApplicationActivateAllWindows flag of -[NSRunningApplication activateWithOptions:], "all of the application's windows are brought forward". That does not actually happen, and has not since at least macOS 10.15. It did work in macOS 10.13, don't know about 10.14. Is there any reasonable alternative to achieve the same effect?
Sometimes, a Mac gets stuck in secure keyboard input mode, which prevents event taps from working. Googling indicates that this is a perennial intermittent problem. I've seen the suggestion to find the responsible process by using the command line
ioreg -l -w 0 | grep SecureInput
and looking for a PID in the output. When this happened to me today, the PID was that of the loginwindow process. That seems to be a bogus "I don't really know" result. In my case, quitting Safari cleared the problem. But is there any better way to find out the real source of the problem than quitting apps one by one?
When I try to turn on sandboxing on a helper tool, it crashes on launch. I thought my problem was solved when I found the post Sandboxed Helper Tool Crashing in libsystem_secinit, but no. I set CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO in the target that builds the tool, and verified that the only entitlement in the built tool is that com.apple.security.app-sandbox is true, but it still crashes.
Backtrace:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_secinit.dylib 0x7ff81af68400 _libsecinit_appsandbox.cold.7 + 49
1 libsystem_secinit.dylib 0x7ff81af6793c _libsecinit_appsandbox + 1831
2 libsystem_trace.dylib 0x7ff80f06649c _os_activity_initiate_impl + 51
3 libsystem_secinit.dylib 0x7ff81af671d4 _libsecinit_initializer + 67
4 libSystem.B.dylib 0x7ff81af7b8b9 libSystem_initializer + 286
5 dyld 0x7ff80efa1618 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 172
6 dyld 0x7ff80efe0de9 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 242
7 dyld 0x7ff80efd4ef7 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 557
8 dyld 0x7ff80ef870b7 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 245
9 dyld 0x7ff80efd40a7 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 175
10 dyld 0x7ff80efe08d2 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 470
11 dyld 0x7ff80efa14f6 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 150
12 dyld 0x7ff80efa9fd4 dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const + 30
13 dyld 0x7ff80efc100d dyld4::APIs::runAllInitializersForMain() + 71
14 dyld 0x7ff80ef8c369 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3743
15 dyld 0x7ff80ef8b281 start + 2289
I'm trying to download a small data file using NSURLSession, but the completion handler is never called (where "never" means I waited long after the specified timeout).
NSURLSessionConfiguration* config =
NSURLSessionConfiguration.ephemeralSessionConfiguration;
config.timeoutIntervalForResource = 120.0;
config.timeoutIntervalForRequest = 120.0;
NSURLSession* session = [NSURLSession sessionWithConfiguration: config];
[session dataTaskWithURL: inURL
completionHandler:
^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error)
{
...
}];
I'm trying to update some old code that used the deprecated NSURLConnection class, and am using the same URL, so I know that the URL is good.
I have a view (custom subclass of NSView) that overrides mouseDown: and mouseUp:. If I double-click the view, I expect to see a sequence of events:
mouseDown with clickCount == 1
mouseUp with clickCount == 1
mouseDown with clickCount == 2
mouseUp with clickCount == 2
Usually, that's what happens. But occasionally, the second or both mouse up events don't arrive. That's a problem, because it's my understanding that if you want to handle a double-click, you should be looking for the second mouse up. I am certain that the mouse location is always within the bounds of the view. What could cause this? (Testing on macOS 13.6.4.)
Added: I use a subclass of NSApplication, and override nextEventMatchingMask:untilDate:inMode:dequeue: and sendEvent:. The overrides usually just call through to the superclass method. Logging mouse events from these methods, I see that in the problematic cases, the mouse up events are received from the queue, but never sent.