NSXPCConnection bug

Preambule


I had prepared this post in a separate text editor and then discovered that I can't paste itin the forum text editor. So if there are typos in the text I had to retype because, in 2017, the text editor of the Apple Developer Forums does not correctly support copy and paste, blame Apple.


That being said:


--------------------


I'm seeing a "funny" (as funny as having to retype this post) issue on OS X 10.8 with NSXPCConnections.


I have a NSXPCConnection whose exportedInterface and exportedObject properties are set in order to have bi-directional communications.


This works fine on OS X 10.10 and later.


This does not work fine on OS X 10.8: the NSXPCDecoder class complains that the exported object does not contain a message/method in its interface.


The problem can be reproduced every time.


After trying multiple stupid things, I think I have found the origin of the issue:


It looks like that, on OS X 10.8 (maybe 10.9 too (1)), the NSXPCConnection API does not support an exported interface built from a protocol that inherits from another protocol.


i.e.


@protocol MyProtocol


- (void)myMessage:(id)object;


@end


MyProtocol will work fine for an exportedInterface when the exported object (a.k.a as the removeObject at this time) calls the myMessage: method.


but


@protocol MyProtocol


- (void)myMessage:(id)object;


@end


@protocol MyOtherProtocol <MyProtocol>


@end


MyOtherProtocol will not work fine for an exportedInterface and the problem only surfaces when the myMessage: method is called.



Question:


Is this a known bug in OS X 10.8?


I had a look at the NSXPCConnection document. I haven't found a reference to this issue.

I had a look at the OS X/Foundation release notes. I have't found a reference to this issue.

I had a look at google search results. I haven't found a valuable reference to this issue.


(1) As the OS X Mavericks v10.9 release notea are messed up (Bug Report already filed), it's difficult to be sure to have read the appropriate Foundation release notes for 10.9).

NSXPCConnection bug
 
 
Q