Posts

Post not yet marked as solved
4 Replies
8.5k Views
Hi,we've got a mixed Swift/Objective C project here. And SourceKit is extremly high CPU consuming. I'm only finding people with the same problem in the Web and no solutions.Anyone here got a solution in the meanwhile? Xcode 10.1 here.Yours,VB.
Posted
by fdik.
Last updated
.
Post marked as solved
5 Replies
1.5k Views
Hi,the LaunchAgent is implemented with this (cutout):@interface ServiceDelegate : NSObject @end @implementation ServiceDelegate - (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection { newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(pEpMacOSAdapterProtocol)]; pEpMacOSAdapter *exportedObject = [pEpMacOSAdapter new]; newConnection.exportedObject = exportedObject; [newConnection resume]; return YES; } @end int main(int argc, const char *argv[]) { ServiceDelegate *delegate = [ServiceDelegate new]; NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:@"foundation.pEp.adapter.macOS"]; [listener resume]; [[NSRunLoop currentRunLoop] run]; return 0; }<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>foundation.pEp.adapter.macOS</string> <key>ProgramArguments</key> <array> <string>/Library/Application Support/pEp/foundation.pEp.adapter.macOS</string> </array> <key>MachServices</key> <dict> <key>foundation.pEp.adapter.macOS</key> <true/> </dict> </dict> </plist>The App is implemented with this (cutout):func proxyErrorHandler(err: Error) -> Void { NSLog("%@", err.localizedDescription) statusText.title = NSLocalizedString("Connection failed", comment: "") } internal func applicationDidFinishLaunching(_ aNotification: Notification) { connection = NSXPCConnection.init(machServiceName: "foundation.pEp.adapter.macOS") if connection != nil { connection.remoteObjectInterface = NSXPCInterface.init(with: pEpMacOSAdapterProtocol.self) connection.resume() statusText.title = NSLocalizedString("Connecting…", comment: "") proxy = connection.remoteObjectProxyWithErrorHandler(proxyErrorHandler) as? pEpMacOSAdapterProtocol proxy?.subscribeForUpdate(downloadNotification: notifyDownload) } else { NSLog("pEpNotifications: %@", "cannot connect to pEp.foundation.adapter.macOS") } }I'm always getting proxyErrorHandler() called with "Couldn’t communicate with a helper application."Any ideas?
Posted
by fdik.
Last updated
.
Post not yet marked as solved
2 Replies
643 Views
When using the Xcode template for XPC service and compiling, the generated binary crashes.To reproduce select File, New, Project, XPC Service, give the name “Sample” and store with defaults. Compile. Try to run the generated binary.$ Debug/Sample.xpc/Contents/MacOS % ./Sample [1] 44094 illegal hardware instruction ./SampleFiled it with feedback assistant https://feedbackassistant.apple.com/feedback/7723709Can anyone confirm? Ideas how to get it to work? Using Xcode Version 11.5 (11E608c) on macOS Catalina 10.15.5 (19F101)
Posted
by fdik.
Last updated
.