Catalyst NSSharingServicePickerToolbarItem - unrecognized selector

Trying to add an `NSSharingServicePickerToolbarItem` to the NStoolbar of my scene's window, but when I set the `NSSharingServicePickerToolbarItem`'s activityItemsConfiguration to a class that implements `UIActivityItemsConfigurationReading` I get -[MYAPP.MYCLASS _uinsApplicationActivityProxies]: unrecognized selector sent to instance 0x6000026331e0


I'm not exactly sure how I can satisfy this unrecognized selector given it appears to be for a private method. Thoughts?

Answered by lennartk in 420548022

Hey,


I've had the same problem, so I thought I'd report my findings. I followed this guide on UIActivityItemsConfigurationReading, but it came with the same error as here. I impleted the (private) methods it was calling (_uinsApplicationActivityProxies, _uinsactivityitemsourceproxies), but then it was calling "operation" on the ActivityItems, so I figured out it was a dead end. By some miracle of clicking through all the (bad) documentation, I found out that UIActivityItemsConfiguration is a thing, which implements UIActivityItemsConfigurationReading.


activityItemsConfiguration = UIActivityItemsConfiguration(itemProviders: [provider])


This did it for me. It is not as nice as implementing the protocol, but it's a pretty good workaround. Hope this gets fixed soon.


Cheers

Hi,


We're encountering the same issue. Does the class that implements UIActivityItemsConfigurationReading need to be of a certain type?


Thanks!

Accepted Answer

Hey,


I've had the same problem, so I thought I'd report my findings. I followed this guide on UIActivityItemsConfigurationReading, but it came with the same error as here. I impleted the (private) methods it was calling (_uinsApplicationActivityProxies, _uinsactivityitemsourceproxies), but then it was calling "operation" on the ActivityItems, so I figured out it was a dead end. By some miracle of clicking through all the (bad) documentation, I found out that UIActivityItemsConfiguration is a thing, which implements UIActivityItemsConfigurationReading.


activityItemsConfiguration = UIActivityItemsConfiguration(itemProviders: [provider])


This did it for me. It is not as nice as implementing the protocol, but it's a pretty good workaround. Hope this gets fixed soon.


Cheers

Catalyst NSSharingServicePickerToolbarItem - unrecognized selector
 
 
Q