I have a project that leverages XPC and has interoperability between Swift and Objective-C++. I am presently getting a compile-time error in one of our unit test targets, of "Argument passed to call that takes no arguments" on the following code:
let interface = NSXPCInterface(with: XPCServiceDelegate.self)
My XPCServiceDelegate protocol is defined as:
@objc(XPCServiceDelegate) public protocol XPCServiceDelegate {
//...
}
For the longest time, this code has compiled successfully, and it has not recently changed. There are two confusing things about this error. The first is that I have a different build scheme that will compile correctly other code with the same structure. The other is that I have team members that are able to compile my failing scheme successfully on the same XCode version, OSVersion, and branch of our repository.
I've attempted numerous things to try to get this code to compile, but I've run out of ideas.
Here's what I've tried:
- Clean build both on XCode 16.4 and XCode 26 Beta
- Delete DerivedData and rebuild on XCode 16.4 and XCode 26 Beta
- Delete and re-clone our git repository
- Uninstall and reinstall XCode
- Attempt to locate cached data for XCode and clear it out. (I'm not sure if I got everything that exists on the system for this.)
- Ensure all OS and XCode updates have been applied.
The interface specification for NSXPCInterface clearly has an initializer with one arguement for the delegate protocol, so I don't know why the compiler would fail for this. Is there some kind of forward declaration or shadowing of NSXPCInterface? Do you have any ideas on what I could try next?