Hello friends,
I saw that iOS 16 has support for NSFileProviderReplicatedExtension, and I was hoping I could use this as a backend for my SSH/SFTP client.
I have attempted to use it by adding a new "File Provider Extension" target to my application, but when I attempt to use it, the system throws an exception shortly after calling my extension constructor, reporting that my class does not respond to the beginRequestWithExtensionContext
:
2022-07-11 17:38:08.775886-0400 SshFs[32841:7522410] -[SshFs.FileProviderExtension beginRequestWithExtensionContext:]: unrecognized selector sent to instance 0x600001f80220
2022-07-11 17:38:08.778225-0400 SshFs[32841:7522410] [xpc.exceptions] <NSXPCConnection: 0x600002c900a0> connection to service with pid 27736 created from an endpoint: Warning: Exception caught during invocation of selector beginRequestWithDomain:alternateContentsDictionary:domainServicer:providerDomain:domainVersion:completionHandler:, dropping incoming message and invalidating the connection.
Exception: -[SshFs.FileProviderExtension beginRequestWithExtensionContext:]: unrecognized selector sent to instance 0x600001f80220
-[SshFs.FileProviderExtension beginRequestWithExtensionContext:]: unrecognized selector sent to instance 0x600001f80220
(
0 CoreFoundation 0x000000018040d20c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x000000018005008c objc_exception_throw + 56
2 CoreFoundation 0x000000018041bd28 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x0000000180411104 ___forwarding___ + 1308
4 CoreFoundation 0x00000001804133fc _CF_forwarding_prep_0 + 92
5 FileProvider 0x000000018feb7c5c -[FPXExtensionContext beginRequestWithDomain:alternateContentsDictionary:domainServicer:providerDomain:domainVersion:completionHandler:] + 1464
6 CoreFoundation 0x00000001804135b0 __invoking___ + 144
7 CoreFoundation 0x0000000180410924 -[NSInvocation invoke] + 276
8 Foundation 0x0000000180cbc798 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT__ + 12
9 Foundation 0x0000000180cbb37c -[NSXPCConnection _decodeAndInvokeMessageWithEvent:reply:flags:] + 1184
10 Foundation 0x0000000180cbd5e0 message_handler_message + 84
11 Foundation 0x0000000180cbcb6c message_handler + 148
12 libxpc.dylib 0x0000000180087420 _xpc_connection_call_event_handler + 68
13 libxpc.dylib 0x00000001800877e0 _xpc_connection_mach_event + 904
14 libdispatch.dylib 0x0000000180134864 _dispatch_client_callout4 + 16
15 libdispatch.dylib 0x0000000180152f08 _dispatch_mach_msg_invoke + 624
16 libdispatch.dylib 0x000000018013c690 _dispatch_lane_serial_drain + 348
17 libdispatch.dylib 0x0000000180153fd4 _dispatch_mach_invoke + 468
18 libdispatch.dylib 0x000000018013c690 _dispatch_lane_serial_drain + 348
19 libdispatch.dylib 0x000000018013d4bc _dispatch_lane_invoke + 448
20 libdispatch.dylib 0x000000018014960c _dispatch_workloop_worker_thread + 772
21 libsystem_pthread.dylib 0x00000001add9bb40 _pthread_wqthread + 284
22 libsystem_pthread.dylib 0x00000001add9a904 start_wqthread + 8
)
I tried with a fresh project, with no baggage, and I get the same error, I uploaded it to GitHub
I am wondering what I might be missing, or if there is some sample code that I could get my hands on, just like there was some for macOS a couple of years back (FruitBasket).