xpc

Running multiple instances of the same XPC service (NSXPCConnection)

一笑奈何 提交于 2019-11-30 06:49:35
Is it possible to run multiple instances of the same XPC service using the XPC APIs found in Foundation.framework ( NSXPCConnection , etc.)? The docs don't provide much insight on this matter. EDIT : Did a quick test, and it seems like only one instance of the service is running even though I created two XPC connections. Is there any way to have it run another instance? I believe XPC services designed for one instance per multiple connections. Probably, it is more convenient to manage named pipes with one running executable. So, the most likely it is impossible to create multiple instances

SMLoginItemSetEnabled sometimes silently fails to launch sandboxed UI helper

情到浓时终转凉″ 提交于 2019-11-29 13:23:03
问题 I have an app that is sandboxed, and includes a helper that presents some UI (as a full-screen window, but could be a status item or similar too). This works... most of the time. But sometimes it doesn't; it just silently fails to start the helper. Since the helper has UI, I use SMLoginItemSetEnabled to load it, then NSXPCConnection to communicate with it. But sometimes SMLoginItemSetEnabled fails to launch it, while still returning YES. This seems to be due to an old build of the app

Running multiple instances of the same XPC service (NSXPCConnection)

…衆ロ難τιáo~ 提交于 2019-11-29 08:38:30
问题 Is it possible to run multiple instances of the same XPC service using the XPC APIs found in Foundation.framework ( NSXPCConnection , etc.)? The docs don't provide much insight on this matter. EDIT : Did a quick test, and it seems like only one instance of the service is running even though I created two XPC connections. Is there any way to have it run another instance? 回答1: I believe XPC services designed for one instance per multiple connections. Probably, it is more convenient to manage

Communicate with another app using XPC

狂风中的少年 提交于 2019-11-28 18:25:04
I have a windowed app, and to add some functionality I need another app which launches at login and sync data to server if available. I have tried with NSDistributionNotification but its practically useless in a sandboxed app. I looked up XPC and hoped it will work but I just dont know how to get it to work with the helper. So far I have done this using XPC. Main App NSXPCInterface *remoteInterface = [NSXPCInterface interfaceWithProtocol:@protocol(AddProtocol)]; NSXPCConnection *xpcConnection = [[NSXPCConnection alloc] initWithServiceName:@"com.example.SampleService"]; xpcConnection

How should Finder Sync Extension and Main App communicate?

泪湿孤枕 提交于 2019-11-28 08:49:14
My use case: I have a 'MainApp' which does the syncing of files. I would like that 'MainApp' handles all server calls regarding syncing and other REST API calls such as document-sharing, etc. On the other hand, I would have a Finder Sync Extension which would show sync-status icon overlays. It would also have a file-context-menu-item 'Share' which would present a Share dialog where users can choose with whom to share the file. Questions: How should FinderSyncExtension and MainApp communicate? Should XCP be utilised and if so, is it ok that communication is two-ways? For example MainApp

XPC connection interrupted in Xcode 7 for iOS 9

僤鯓⒐⒋嵵緔 提交于 2019-11-27 18:16:57
I recently updated to Xcode 7 and upgraded my iPhone to iOS 9. I have developed and released an iOS app that had worked perfectly fine on the latest version of iOS 8 and Xcode 6. Upon trying to go through the process of updated the app for iOS 9 support, I am getting the most ridiculously strange error that has left me baffled. I have done all the syntax corrections automatically through Xcode, and now my app builds properly. It even runs fine at first. I have a button that segues to a view controller with a WebView. This view controller loads a link that will display either an image, website,

App sandbox: how to allow XPC service to read file that user opened in parent app?

有些话、适合烂在心里 提交于 2019-11-27 13:15:06
问题 I have a simple Cocoa image preview app. The user selects a file using an NSOpenPanel and the app generates a preview image using the Quick Look API. I'd like to move the preview generation into a separate XPC service. Without app sandboxing everything works fine, but after enabling app sandboxing for the parent app and the XPC service, the XPC service is denied read access to the user selected file . The parent app is allowed to read the file (because it was selected through an NSOpenPanel).

XPC connection interrupted in Xcode 7 for iOS 9

情到浓时终转凉″ 提交于 2019-11-26 19:25:52
问题 I recently updated to Xcode 7 and upgraded my iPhone to iOS 9. I have developed and released an iOS app that had worked perfectly fine on the latest version of iOS 8 and Xcode 6. Upon trying to go through the process of updated the app for iOS 9 support, I am getting the most ridiculously strange error that has left me baffled. I have done all the syntax corrections automatically through Xcode, and now my app builds properly. It even runs fine at first. I have a button that segues to a view