У меня есть огромная проблема для передачи NSAttributtedString в обратном вызове блока из службы XPC.Служба XPC, возвращающая NSAttributtedString
Я пытаюсь вернуть основную строку как:
NSDictionary *arrayComa = @{NSForegroundColorAttributeName:[NSColor colorWithRGB:0xD35250],
NSFontAttributeName:[NSFont fontWithName:@"Monaco" size:11]};
NSMutableAttributedString *testString = [[NSMutableAttributedString alloc] initWithString:@"{}" attributes:arrayComa];
Я также белый список входящий ответ, как:
let incommingClasses:Set = Set(arrayLiteral: [NSMutableAttributedString.self, NSAttributedString.self, NSColor.self, NSFont.self, NSString.self, ])
connectionService.remoteObjectInterface?.setClasses(incommingClasses, forSelector: attributtedText:withReply:, argumentIndex: 0, ofReply: true)
Что я когда-либо я получаю ошибки:
Exception caught during decoding of received reply to message 'Exception caught during decoding of received reply to message 'attributtedText:withReply':, dropping incoming message and calling failure block.
Exception: Exception while decoding argument 0 (#1 of invocation):
<NSInvocation: 0x6000006649c0>
return value: {v} void
target: {@?} 0x0 (block)
argument 1: {@"NSMutableAttributedString"} 0x0
Exception: value for key '<no key>' was of unexpected class 'NSMutableAttributedString'. Allowed classes are '{(
(
NSMutableAttributedString,
NSAttributedString,
NSColor,
NSFont,
NSString
)
)} '.
Кто-нибудь передал NSAttributtedText через службу XPC успешно?