Assertion failure in -[SHKSharingService launchExtensionWithExtensionItem:options:]

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Assertion failure in -[SHKSharingService launchExtensionWithExtensionItem:options:]

    Hallo,

    ich habe auf XCode Version 11.3.1 updated und bekomme nun diese Assertion:

    *** Assertion failure in -[SHKSharingService launchExtensionWithExtensionItem:options:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/ShareKit/ShareKit-641.5/ShareKit/framework/SHKSharingService.m:2943

    wenn der folgende Code ausgeführt wird.

    Quellcode

    1. @property (strong, nonatomic) NSSharingService * emailService;
    2. ....
    3. NSArray * mails = ...;
    4. for (NSMutableDictionary * properties in mails) {
    5. // USLog(@"email info: %@", properties);
    6. self.emailService.recipients = [properties valueForKey:@"headOfTeam"]; // array of email-adresses
    7. self.emailService.subject = [properties valueForKey:@"subject"];
    8. [self.emailService performWithItems:@[[properties valueForKey:@"content"]]];
    9. }

    Auch ein Try..catch Bloch und die Zeile "[self.emailService performWithItems:..:]" fängt diese Assertion nicht.

    Warum bekomme ich die Assertion?



    Danke im voraus für Tips.
    Wenn Du immer nur das tust was du schon kannst - wirst du immer das bleiben, was du heute bist.
  • Hi, in dem Array sind dictionary's mit strings. Nix kompliziertes - eigentlich.

    Für jede Mail liefert canPerformWithItems YES.

    Die Assertion liefert nun auch mehr details: Sie wie es aussieht gibt es intern einen Timer der nicht gelöscht werden kann!?

    Quellcode

    1. 020-01-19 16:28:52.821138+0100 Thot[28541:1449364] *** Assertion failure in -[SHKSharingService launchExtensionWithExtensionItem:options:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/ShareKit/ShareKit-641.5/ShareKit/framework/SHKSharingService.m:2943
    2. 2020-01-19 16:28:52.823411+0100 Thot[28541:1449364] [General] An uncaught exception was raised
    3. 2020-01-19 16:28:52.823479+0100 Thot[28541:1449364] [General] Cancel Potential Unregister Timer not set
    4. 2020-01-19 16:28:52.823544+0100 Thot[28541:1449364] [General] (
    5. 0 CoreFoundation 0x00007fff3bd568ab __exceptionPreprocess + 250
    6. 1 libobjc.A.dylib 0x00007fff71fc7805 objc_exception_throw + 48
    7. 2 CoreFoundation 0x00007fff3bd7fd10 +[NSException raise:format:arguments:] + 88
    8. 3 Foundation 0x00007fff3e478221 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
    9. 4 ShareKit 0x00007fff68ddde5d __62-[SHKSharingService launchExtensionWithExtensionItem:options:]_block_invoke_2 + 1394
    10. 5 libdispatch.dylib 0x00000001006a67b3 _dispatch_call_block_and_release + 12
    11. 6 libdispatch.dylib 0x00000001006a778f _dispatch_client_callout + 8
    12. 7 libdispatch.dylib 0x00000001006b76ac _dispatch_main_queue_callback_4CF + 1865
    13. 8 CoreFoundation 0x00007fff3bd19e00 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    14. 9 CoreFoundation 0x00007fff3bcd9b8a __CFRunLoopRun + 2370
    15. 10 CoreFoundation 0x00007fff3bcd8bd3 CFRunLoopRunSpecific + 499
    16. 11 HIToolbox 0x00007fff3a82f65d RunCurrentEventLoopInMode + 292
    17. 12 HIToolbox 0x00007fff3a82f39d ReceiveNextEventCommon + 600
    18. 13 HIToolbox 0x00007fff3a82f127 _BlockUntilNextEventMatchingListInModeWithFilter + 64
    19. 14 AppKit 0x00007fff38ea0eb4 _DPSNextEvent + 990
    20. 15 AppKit 0x00007fff38e9f690 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
    21. 16 AppKit 0x00007fff38e913ae -[NSApplication run] + 658
    22. 17 AppKit 0x00007fff38e63775 NSApplicationMain + 777
    23. 18 Thot 0x0000000100022472 main + 34
    24. 19 libdyld.dylib 0x00007fff733357fd start + 1
    25. )
    26. 2020-01-19 16:28:52.824140+0100 Thot[28541:1449364] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cancel Potential Unregister Timer not set'
    27. *** First throw call stack:
    28. (
    29. 0 CoreFoundation 0x00007fff3bd568ab __exceptionPreprocess + 250
    30. 1 libobjc.A.dylib 0x00007fff71fc7805 objc_exception_throw + 48
    31. 2 CoreFoundation 0x00007fff3bd7fd10 +[NSException raise:format:arguments:] + 88
    32. 3 Foundation 0x00007fff3e478221 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
    33. 4 ShareKit 0x00007fff68ddde5d __62-[SHKSharingService launchExtensionWithExtensionItem:options:]_block_invoke_2 + 1394
    34. 5 libdispatch.dylib 0x00000001006a67b3 _dispatch_call_block_and_release + 12
    35. 6 libdispatch.dylib 0x00000001006a778f _dispatch_client_callout + 8
    36. 7 libdispatch.dylib 0x00000001006b76ac _dispatch_main_queue_callback_4CF + 1865
    37. 8 CoreFoundation 0x00007fff3bd19e00 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    38. 9 CoreFoundation 0x00007fff3bcd9b8a __CFRunLoopRun + 2370
    39. 10 CoreFoundation 0x00007fff3bcd8bd3 CFRunLoopRunSpecific + 499
    40. 11 HIToolbox 0x00007fff3a82f65d RunCurrentEventLoopInMode + 292
    41. 12 HIToolbox 0x00007fff3a82f39d ReceiveNextEventCommon + 600
    42. 13 HIToolbox 0x00007fff3a82f127 _BlockUntilNextEventMatchingListInModeWithFilter + 64
    43. 14 AppKit 0x00007fff38ea0eb4 _DPSNextEvent + 990
    44. 15 AppKit 0x00007fff38e9f690 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
    45. 16 AppKit 0x00007fff38e913ae -[NSApplication run] + 658
    46. 17 AppKit 0x00007fff38e63775 NSApplicationMain + 777
    47. 18 Thot 0x0000000100022472 main + 34
    48. 19 libdyld.dylib 0x00007fff733357fd start + 1
    49. )
    50. libc++abi.dylib: terminating with uncaught exception of type NSException
    Alles anzeigen
    Wenn Du immer nur das tust was du schon kannst - wirst du immer das bleiben, was du heute bist.

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von uschu.do ()

  • Hi, ich denke ich habs gefunden. Nachdem ich in der for:in Schleife alle Mails dem NSSharingService über mittels habe, ist der View entfernt der es erlaubt hat den Mail-Body zu ändern.

    Nun verwende ich den NSSharingServiceDelegate und entferne erst dann den Mail-Body Editor, wenn alle Mails gesendet sind. Das passiert nun alles in "sharingService:didShareItems:".


    Quellcode

    1. - (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items {
    2. if ( self.mailIndex >= self.mails.count ) {
    3. // all mails are sended!
    4. self.mails = nil;
    5. // remove view to edit mail body.
    6. [self startChecker:_currentViewTag];
    7. }
    8. else {
    9. // Send next mail ...
    10. NSMutableDictionary * properties = self.mails[self.mailIndex];
    11. USLog(@"send item[%li]", self.mailIndex);
    12. self.emailService.recipients = [properties valueForKey:@"headOfTeam"]; // array of email-adresses
    13. self.emailService.subject = [properties valueForKey:@"subject"];
    14. [self.emailService performWithItems:@[[properties valueForKey:@"content"]]];
    15. self.mailIndex++;
    16. }
    17. }
    Alles anzeigen
    :)
    Wenn Du immer nur das tust was du schon kannst - wirst du immer das bleiben, was du heute bist.