Processes & Concurrency

RSS for tag

Discover how the operating system manages multiple applications and processes simultaneously, ensuring smooth multitasking performance.

Concurrency Documentation

Posts under Processes & Concurrency subtopic

Post

Replies

Boosts

Views

Activity

Launch Host App from Share Extension
Hi! Could you please point me to the official documentation or recommended approach for launching the host app from a Share Extension? The scenario is: The user is sharing some text to my app. I need launch App and show this text. At the moment, I'm using the following hack: let selector = NSSelectorFromString("sharedApplication") if let app = UIApplication.perform(selector)?.takeUnretainedValue() as? UIApplication, app.responds(to: #selector(UIApplication.open(_:options:completionHandler:))) { app.open(url, options: [:], completionHandler: nil) } This does work, but it's terrible. So, the question: What is the official way to open the host app from within a Share Extension? Thanks!
2
0
113
Apr ’25
Working with Input/Output stream with Swift 6 and concurrency framework
Hello, I am developing an application which is communicating with external device using BLE and L2CAP. I wonder what are the best practices of using Input & Output streams that are established with L2CAP connection when working with Swift 6 concurrency model. I've been trying to find some examples and hints for some time now but unfortunately there isn't much available. One useful thread I've found is: https://developer.apple.com/forums/thread/756281 but it does not offer much insight into using eg. actor model with streams. I wonder if something has changed in this regards? Also, are there any plans to migrate eg. CoreBluetooth stack to new swift 6 concurrency ?
2
0
96
Apr ’25
Question about BGAppRefreshTask approach for medication scheduling app
I'm developing a medication scheduling app similar to Apple Health's Medications feature, and I'd like some input on my current approach to background tasks. In my app, when a user creates a medication, I generate ScheduledDose objects (with corresponding local notifications) for the next 2 weeks and save them to SwiftData. To ensure this 2-week window stays current, I've implemented a BGAppRefreshTask that runs daily to generate new doses as needed. My concern is whether BGAppRefreshTask is the appropriate mechanism for this purpose. Since I'm not making any network requests but rather generating and storing local data, I'm questioning if this is the right approach. I'm also wondering how Apple Health's Medications feature handles this kind of scheduling. Their app seems to maintain future doses regardless of app usage patterns. Has anyone implemented something similar or can suggest the best background execution API for this type of scenario? Thanks for any guidance you can provide.
2
0
111
Apr ’25
Background Assets Extension and DeviceCheck
Hi, I have some questions regarding the Background Assets Extension and DeviceCheck framework. Goal: Ensure that only users who have purchased the app can access the server's API without any user authentication using for example DeviceCheck framework and within a Background Assets Extension. My app relies on external assets, which I'm loading using the Background Assets Extension. I'm trying to determine if it's possible to obtain a challenge from the server and send a DeviceCheck assertion during this process within the Background Assets Extension. So far, I only receive session-wide authentication challenges—specifically NSURLAuthenticationMethodServerTrust in the Background Assets Extensio. I’ve tested with Basic Auth (NSURLAuthenticationMethodHTTPBasic) just for experimentation, but the delegate func backgroundDownload( _ download: BADownload, didReceive challenge: URLAuthenticationChallenge ) async -> (URLSession.AuthChallengeDisposition, URLCredential?) is never called with that authentication method. It seems task-specific challenges aren't coming through at all. Also, while the DCAppAttestService API appears to be available on macOS, DCAppAttestService.isSupported always returns false (in my testing), which suggests it's not actually supported on macOS. Can anyone confirm if that’s expected behavior?
2
0
99
May ’25
Is there an API to programmatically obtain an XPC Service's execution context?
Hello! I'm writing a System Extension that is an Endpoint Security client. And I want to Deny/Allow executing some XPC Service processes (using the ES_EVENT_TYPE_AUTH_EXEC event) depending on characteristics of a process that starts the XPC Service. For this purpose, I need an API that could allow me to obtain an execution context of the XPC Service process. I can obtain this information using the "sudo launchctl procinfo <pid>" command (e.g. I can use the "domain = pid/3428" part of the output for this purpose). Also, I know that when the xpcproxy process is started, it gets as the arguments a service name and a pid of the process that requests the service so I can grasp the execution context from xpcproxy launching. But are these ways to obtain this info legitimate?
2
0
143
Apr ’25
SMAppService getting notified when status changes externally (from System Settings)
Say I want to sync a toggle in my app with SMAppService's .status property. If the status changes from my app I can track it. But if user toggles it from System Settings, I don't see a notification so then the UI in my app is out of date. The status property is not key value observable and there doesn't appear to be a SMAppServiceStatusDidChangeNotification ? I can re-read it every time my app will become active but feels kind of wrong to do it this way.
2
0
56
May ’25
SMAppService Error 108 'Unable to read plist' on macOS 15 - Comprehensive Analysis & Test Case
SMAppService Error 108 "Unable to read plist" on macOS 15 Sequoia - Comprehensive Test Case Summary We have a fully notarized SMAppService implementation that consistently fails with Error 108 "Unable to read plist" on macOS 15 Sequoia, despite meeting all documented requirements. After systematic testing including AI-assisted analysis, we've eliminated all common causes and created a comprehensive test case. Error: SMAppServiceErrorDomain Code=108 "Unable to read plist: com.keypath.helperpoc.helper" 📋 Complete Repository: https://github.com/malpern/privileged_helper_help What We've Systematically Verified ✅ Perfect bundle structure: Helper at Contents/MacOS/, plist at Contents/Library/LaunchDaemons/ Correct SMAuthorizedClients: Embedded in helper binary via CREATE_INFOPLIST_SECTION_IN_BINARY=YES Aligned identifiers: Main app, helper, and plist all use consistent naming Production signing: Developer ID certificates with full Apple notarization and stapling BundleProgram paths: Tested both Contents/MacOS/helperpoc-helper and simplified helperpoc-helper Entitlements: Tested with and without com.apple.developer.service-management.managed-by-main-app What Makes This Different Systematic methodology: Not a "help me debug" post - we've done comprehensive testing Expert validation: AI analysis helped eliminate logical hypotheses Reproduction case: Minimal project that demonstrates the issue consistently Complete documentation: All testing steps, configurations, and results documented Use Case Context We're building a keyboard remapper that integrates with https://github.com/jtroo/kanata and needs privileged daemon registration for system-wide keyboard event interception. Key Questions Does anyone have a working SMAppService implementation on macOS 15 Sequoia? Are there undocumented macOS 15 requirements we're missing? Is Error 108 a known issue with specific workarounds? Our hypothesis: This appears to be a macOS 15 system-level issue rather than configuration error, since our implementation meets all documented Apple requirements but fails consistently. Has anyone encountered similar SMAppService issues on macOS 15, or can confirm a working implementation?
2
0
238
Jul ’25
BGContinuedProcessingTask compatibility with background URLSession
My app does really large uploads. Like several GB. We use the AWS SDK to upload to S3. It seemed like using BGContinuedProcessingTask to complete a set of uploads for a particular item may improve UX as well as performance and reliability. When I tried to get BGContinuedProcessingTask working with the AWS SDK I found that the task would fail after maybe 30 seconds. It looked like this was because the app stopped receiving updates from the AWS upload and the task wants consistent updates. The AWS SDK always uses a background URLSession and this is not configurable. I understand the background URLSession runs in a separate process from the app and maybe that is why progress updates did not continue when the app was in the background. Is it expected that BGContinuedProcessingTask and background URLSession are not really compatible? It would not be shocking since they are 2 separate background APIs. Would the Apple recommendation be to use a normal URLSession for this, in which case AWS would need to change their SDK? Or does Apple think that BGContinuedProcessingTask should just not be used with uploads? In other words use an upload specific API. Thanks!
2
0
87
Aug ’25
Electron app with Express + Python child processes not running in macOS production build
Hi all, I’ve built an Electron application that uses two child processes: An Express.js server A Python executable (packaged .exe/binary) During the development phase, everything works fine — the Electron app launches, both child processes start, and the app functions as expected. But when I create a production build for macOS, the child processes don’t run. Here’s a simplified snippet from my electron.mjs: import { app, BrowserWindow } from "electron"; import { spawn } from "child_process"; import path from "path"; let mainWindow; const createWindow = () =&gt; { mainWindow = new BrowserWindow({ width: 1200, height: 800, webPreferences: { nodeIntegration: true, }, }); mainWindow.loadFile("index.html"); // Start Express server const serverPath = path.join(process.resourcesPath, "app.asar.unpacked", "server", "index.js"); const serverProcess = spawn(process.execPath, [serverPath], { stdio: "inherit", }); // Start Python process const pythonPath = path.join(process.resourcesPath, "app.asar.unpacked", "python", "myapp"); const pythonProcess = spawn(pythonPath, [], { stdio: "inherit", }); serverProcess.on("error", (err) =&gt; console.error("Server process error:", err)); pythonProcess.on("error", (err) =&gt; console.error("Python process error:", err)); }; app.whenReady().then(createWindow); I’ve already done the following: Configured package.json with the right build settings Set up extraResources / asarUnpack to include the server and Python files Verified both child processes work standalone Questions: What’s the correct way to package and spawn these child processes for macOS production builds? Do I need to move them into a specific location (like Contents/Resources/app.asar.unpacked) and reference them differently? Is there a more reliable pattern for handling Express + Python child processes inside an Electron app bundle? Any insights or working examples would be really appreciated!
2
0
39
2w
XPC codesign requirement crashes application
We have an application that sets a code signing requirement on a XPC connection between a File Provider extension and the main application. Only with a specific Developer ID certificate <DEVELOPER_ID_TEAM_IDENTIFIER> that designated requirement is not accepted and the application crashes with EXC_CRASH (SIGABRT) and the stacktrace Thread 1 Crashed:: Dispatch queue: com.apple.root.default-qos 0 libsystem_kernel.dylib 0x19b556388 __pthread_kill + 8 1 libsystem_pthread.dylib 0x19b58f88c pthread_kill + 296 2 libsystem_c.dylib 0x19b498a3c abort + 124 3 libc++abi.dylib 0x19b545384 abort_message + 132 4 libc++abi.dylib 0x19b533cf4 demangling_terminate_handler() + 344 5 libobjc.A.dylib 0x19b1b8dd4 _objc_terminate() + 156 6 libc++abi.dylib 0x19b544698 std::__terminate(void (*)()) + 16 7 libc++abi.dylib 0x19b547c30 __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88 8 libc++abi.dylib 0x19b547bd8 __cxa_throw + 92 9 libobjc.A.dylib 0x19b1aecf8 objc_exception_throw + 448 10 Foundation 0x19d5c3840 -[NSXPCConnection setCodeSigningRequirement:] + 140 11 libxpcfileprovider.dylib 0x301023048 NSXPCConnection.setCodeSigningRequirementFromTeamIdentifier(_:) + 1796 12 libxpcfileprovider.dylib 0x30101dc94 closure #1 in CallbackFileProviderManager.getFileProviderConnection(_:service:completionHandler:interruptionHandler:exportedObject:) + 1936 13 libxpcfileprovider.dylib 0x30101e110 thunk for @escaping @callee_guaranteed @Sendable (@guaranteed NSXPCConnection?, @guaranteed Error?) -> () + 80 14 Foundation 0x19d46c3a4 __72-[NSFileProviderService getFileProviderConnectionWithCompletionHandler:]_block_invoke_2.687 + 284 15 libdispatch.dylib 0x19b3d7b2c _dispatch_call_block_and_release + 32 16 libdispatch.dylib 0x19b3f185c _dispatch_client_callout + 16 17 libdispatch.dylib 0x19b40e490 + 32 18 libdispatch.dylib 0x19b3e9fa4 _dispatch_root_queue_drain + 736 19 libdispatch.dylib 0x19b3ea5d4 _dispatch_worker_thread2 + 156 20 libsystem_pthread.dylib 0x19b58be28 _pthread_wqthread + 232 21 libsystem_pthread.dylib 0x19b58ab74 start_wqthread + 8 The designated codesign requirement on the XPC connection is set to anchor apple generic and certificate leaf[subject.OU] = <DEVELOPER_ID_TEAM_IDENTIFIER>" We have verified the designated code sign requirement to be valid on both the main bundle and the embedded extension using: codesign --verify -v -R '=anchor apple generic and certificate leaf[subject.OU] = "<DEVELOPER_ID_TEAM_IDENTIFIER>"' *.app codesign --verify -v -R '=anchor apple generic and certificate leaf[subject.OU] = "<DEVELOPER_ID_TEAM_IDENTIFIER>"' *.app/Contents/PlugIns/*
2
0
43
3d
Timer driven refresh
I have an app that needs to refresh a server whenever a Contacts record is updated. I can observe Contacts, but that only seems to work when my app is running (and in foreground, which it cannot be on iPhone if the Contacts app is being updated). I want it to process, even if my app is in background, or has been terminated (swiped away), or after a phone restart. The only way I can think of is to periodically push a notification to the app from an external server. Is there any way to run a timer that sends a notification to the app on a periodic basis? The timers you can set seem to run even if the Clock app is swiped away, or following a phone restart. Is there anything like that I could use to wake my app periodically?
1
0
600
Oct ’24
AsyncStream stops dispatching
Hello I'm a beginner to Swift Concurrency and have run into an issue with AsyncStream. I've run into a situation that causes an observing of a for loop to receiving a values from an AsyncStream. At the bottom is the code that you can copy it into a Swift Playground and run. The code is supposed to mock a system that has a service going through a filter to read and write to a connection. Here is a log of the prints 🙈🫴 setupRTFAsyncWrites Start ⬅️ Pretend to write 0 ➡️ Pretend to read 0 feed into filter 0 yield write data 1 🙈🫴 setupRTFAsyncWrites: write(1 bytes) ⬅️🙈🫴 Async Event: dataToDevice: 1 bytes ⬅️ Pretend to write 1 ➡️ Pretend to read 1 feed into filter 1 yield write data 2 // here our for loop should have picked up the value sent down the continuation. But instead it just sits here. Sample that can go into a playground //: A UIKit based Playground for presenting user interface import SwiftUI import PlaygroundSupport import Combine import CommonCrypto import Foundation class TestConnection { var didRead: ((Data) -&gt; ()) = { _ in } var count = 0 init() { } func write(data: Data) { // pretend we sent this to the BT device print("⬅️ Pretend to write \(count)") Task { try await Task.sleep(ms: 200) print("➡️ Pretend to read \(self.count)") self.count += 1 // pretend this is a response from the device self.didRead(Data([0x00])) } } } enum TestEvent: Sendable { /// ask some one to write this to the device case write(Data) /// the filter is done case handshakeDone } class TestFilter { var eventsStream: AsyncStream&lt;TestEvent&gt; var continuation: AsyncStream&lt;TestEvent&gt;.Continuation private var count = 0 init() { (self.eventsStream, self.continuation) = AsyncStream&lt;TestEvent&gt;.makeStream(bufferingPolicy: .unbounded) } func feed(data: Data) { print("\tfeed into filter \(count)") count += 1 if count &gt; 5 { print("\t✅ handshake done") self.continuation.yield(.handshakeDone) return } Task { // data delivered to us by a bluetooth device // pretend it takes time to process this and then we return with a request to write back to the connection try await Task.sleep(ms: 200) print("\tyield write data \(self.count)") // pretend this is a response from the device let result = self.continuation.yield(.write(Data([0x11]))) } } /// gives the first request to fire to the device for the handshaking sequence func start() -&gt; Data { return Data([0x00]) } } // Here we facilitate communication between the filter and the connection class TestService { private let filter: TestFilter var task: Task&lt;(), Never&gt;? let testConn: TestConnection init(filter: TestFilter) { self.filter = filter self.testConn = TestConnection() self.testConn.didRead = { [weak self] data in self?.filter.feed(data: data) } self.task = Task { [weak self] () in await self?.setupAsyncWrites() } } func setupAsyncWrites() async { print("🙈🫴 setupRTFAsyncWrites Start") for await event in self.filter.eventsStream { print("\t\t🙈🫴 setupRTFAsyncWrites: \(event)") guard case .write(let data) = event else { print("\t\t🙈🫴 NOT data to device: \(event)") continue } print("\t\t⬅️🙈🫴 Async Event: dataToDevice: \(data)") self.testConn.write(data: data) } // for // This shouldn't end assertionFailure("This should not end") } public func handshake() async { let data = self.filter.start() self.testConn.write(data: data) await self.waitForHandshakedone() } private func waitForHandshakedone() async { for await event in self.filter.eventsStream { if case .handshakeDone = event { break } continue } } } Task { let service = TestService(filter: TestFilter()) await service.handshake() print("Done") } /* This is what happens: 🙈🫴 setupRTFAsyncWrites Start ⬅️ Pretend to write 0 ➡️ Pretend to read 0 feed into filter 0 yield write data 1 🙈🫴 setupRTFAsyncWrites: write(1 bytes) ⬅️🙈🫴 Async Event: dataToDevice: 1 bytes ⬅️ Pretend to write 1 ➡️ Pretend to read 1 feed into filter 1 yield write data 2 // It just stops here, the `for` loop in setupAsyncWrites() should have picked up the event sent down the continuation after "yield write data 2" // It should say 🙈🫴 setupRTFAsyncWrites: write(1 bytes) ⬅️🙈🫴 Async Event: dataToDevice: 1 bytes */ extension Task&lt;Never, Never&gt; { public static func sleep(ms duration: UInt64) async throws { try await Task.sleep(nanoseconds: 1_000_000 * duration) } }
1
0
490
Oct ’24
Background sync
I am developing an application usinh native apps, where the app needs to continuously sync data (such as daily tasks and orders) even when offline or running in the background. However, on iOS, the background sync stops after 30 seconds, limiting the functionality. The Background Sync API and Service Workers seem restricted on iOS, causing syncing to fail when the app is in the background or offline. What is the best way to ensure continuous background synchronization on iOS? Additionally, what is the most efficient data storage approach for managing offline capabilities and syncing smoothly when the network is unstable and for the background sync?
1
0
537
Oct ’24
iOS 18.1 崩溃问题
我这边用了几台机器升级iOS 18.1并没有测试出来问题,但是审核员测试出来了问题,并将崩溃报告发给了我。 以下是审核员发给我的的测试环境及崩溃报告: Device type: iPad Air (5th generation) OS version: iOS 18.1 崩溃报告如下: Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libobjc.A.dylib 0x196ae7c38 objc_msgSend + 56 1 UIKitCore 0x19bf9c0f4 -[UIView bounds] + 32 2 UIKitCore 0x19c14e15c -[UIScrollView _didEndDirectManipulationWithScrubbingDirection:] + 108 3 UIKitCore 0x19d4cd3e8 -[UIScrollView _stopScrollingNotify:pin:tramplingAnimationDependentFlags:] + 108 4 UIKitCore 0x19d4cd548 -[UIScrollView _stopScrollingAndZoomingAnimationsPinningToContentViewport:tramplingAnimationDependentFlags:] + 52 5 UIKitCore 0x19c385a28 -[UIScrollView dealloc] + 88 6 libsystem_blocks.dylib 0x221c29860 bool HelperBase::disposeCapture<(HelperBase::BlockCaptureKind)3>(unsigned int, unsigned char*) + 68 7 libsystem_blocks.dylib 0x221c29570 HelperBase::destroyBlock(Block_layout*, bool, unsigned char*) + 160 8 libsystem_blocks.dylib 0x221c29030 _call_dispose_helpers_excp + 72 9 libsystem_blocks.dylib 0x221c28fcc _Block_release + 256 10 libdispatch.dylib 0x1a14fe0d0 _dispatch_client_callout + 20 11 libdispatch.dylib 0x1a150c9e0 _dispatch_main_queue_drain + 980 12 libdispatch.dylib 0x1a150c5fc _dispatch_main_queue_callback_4CF + 44 13 CoreFoundation 0x1997fc204 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 14 CoreFoundation 0x1997f9440 __CFRunLoopRun + 1996 15 CoreFoundation 0x1997f8830 CFRunLoopRunSpecific + 588 16 GraphicsServices 0x1e57d81c4 GSEventRunModal + 164 17 UIKitCore 0x19c35eeb0 -[UIApplication _run] + 816 18 UIKitCore 0x19c40d5b4 UIApplicationMain + 340 19 BXT 0x104d90090 0x104aa4000 + 3063952 20 dyld 0x1bf1e6ec8 start + 2724 Thread 1: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 3: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 4 name: com.apple.uikit.eventfetch-thread Thread 4: 0 libsystem_kernel.dylib 0x1e9bba688 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x1e9bbdd98 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x1e9bbdcb0 mach_msg_overwrite + 424 3 libsystem_kernel.dylib 0x1e9bbdafc mach_msg + 24 4 CoreFoundation 0x1997f9a84 __CFRunLoopServiceMachPort + 160 5 CoreFoundation 0x1997f9130 __CFRunLoopRun + 1212 6 CoreFoundation 0x1997f8830 CFRunLoopRunSpecific + 588 7 Foundation 0x1984a0500 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 8 Foundation 0x1984a0350 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 9 UIKitCore 0x19c372358 -[UIEventFetcher threadMain] + 420 10 Foundation 0x1984b16c8 NSThread__start + 724 11 libsystem_pthread.dylib 0x221c3137c _pthread_start + 136 12 libsystem_pthread.dylib 0x221c2c494 thread_start + 8 Thread 5: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 6: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 7: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 8: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 9: 0 libsystem_pthread.dylib 0x221c2c480 start_wqthread + 0 Thread 10 name: JavaScriptCore libpas scavenger Thread 10: 0 libsystem_kernel.dylib 0x1e9bbff90 __psynch_cvwait + 8 1 libsystem_pthread.dylib 0x221c2ea50 _pthread_cond_wait + 1204 2 JavaScriptCore 0x1b156aca4 scavenger_thread_main + 1512 3 libsystem_pthread.dylib 0x221c3137c _pthread_start + 136 4 libsystem_pthread.dylib 0x221c2c494 thread_start + 8 Thread 11 name: WebThread Thread 11: 0 libsystem_kernel.dylib 0x1e9bba688 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x1e9bbdd98 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x1e9bbdcb0 mach_msg_overwrite + 424 3 libsystem_kernel.dylib 0x1e9bbdafc mach_msg + 24 4 CoreFoundation 0x1997f9a84 __CFRunLoopServiceMachPort + 160 5 CoreFoundation 0x1997f9130 __CFRunLoopRun + 1212 6 CoreFoundation 0x1997f8830 CFRunLoopRunSpecific + 588 7 WebCore 0x1ad46bb18 RunWebThread(void*) + 780 8 libsystem_pthread.dylib 0x221c3137c _pthread_start + 136 9 libsystem_pthread.dylib 0x221c2c494 thread_start + 8 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x00000003029b1840 x1: 0x0000000208981838 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x0000000000000001 x5: 0x00000f0300000000 x6: 0x0000000000000002 x7: 0x0000000000000000 x8: 0x00000000000000a0 x9: 0x0000000208981838 x10: 0x00000000024b036c x11: 0x00000000024b036c x12: 0x0000000000000000 x13: 0x00000000024b036c x14: 0x00000003029b1bc0 x15: 0x00000003029b1bc0 x16: 0x00000003029b1bc0 x17: 0x0000000205f46018 x18: 0x0000000000000000 x19: 0x0000000136841400 x20: 0x00000001fd5f4588 x21: 0xffffffffffffffff x22: 0x00000000000006d8 x23: 0x0000000136841ad8 x24: 0x0000000000000000 x25: 0x00000001fd5969e0 x26: 0x00000003032b7640 x27: 0x000000000000000f x28: 0x0000000000000000 fp: 0x000000016b35a4e0 lr: 0x000000019bf9c0f4 sp: 0x000000016b35a4e0 pc: 0x0000000196ae7c38 cpsr: 0x20001000 far: 0x00000000024b036c esr: 0x92000006 (Data Abort) byte read Translation fault
1
0
622
Nov ’24
The source editor extension can't connect xpc service
I created a macOS app, added an XPC service target, and also added a source editor extension. in The source editor extension‘s perform function. It doesn't work - (void)performCommandWithInvocation:(XCSourceEditorCommandInvocation *)invocation completionHandler:(void (^)(NSError * _Nullable nilOrError))completionHandler { self.xpcConnect = [[NSXPCConnection alloc] initWithServiceName:@"test.TestNewXPCApp.NewXPC"]; NSXPCInterface *interface = [NSXPCInterface interfaceWithProtocol:@protocol(NewXPCProtocol)]; self.xpcConnect.remoteObjectInterface = interface; [self.xpcConnect resume]; [[self.xpcConnect remoteObjectProxy] performCalculationWithNumber:@231 andNumber:@119 withReply:^(NSNumber *reply) { // We have received a response. NSLog(@"ui success%@", reply); }]; But In ViewControler.m, executing the same code , it can work. So why is it possible to connect to the XPC service from within the macOS app, but not from the source editor extension?
1
0
447
Nov ’24
Creating a custom Application Launcher
Hi, I want to create a custom application launcher, so I'd like the app to be able to just list the apps installed and launch them when touched. My idea is to have a Minimalist UI in order to enhance productivity. Is it possible? I see there is already one App doing it https://apps.apple.com/us/app/dumb-phone/id6504743503 I want to do something similar, so how does the App in the link obtains the Apps installed on the device?
1
0
451
Nov ’24