gpt4 book ai didi

swift - 使用 NSSharingServicePicker 类时出现警告信息

转载 作者:可可西里 更新时间:2023-11-01 01:08:54 26 4
gpt4 key购买 nike

2018-05-03 18:31:54.879424+0800 writer[5656:137819] warning: illegal subclass SHKRemoteView instantiating; client should use only NSRemoteView ( 0 ViewBridge
0x00007fff7a0cabff -[NSRemoteView _preSuperInit] + 195 1 ViewBridge 0x00007fff7a0caf83 -[NSRemoteView initWithFrame:] + 25 2 ShareKit
0x00007fff763b7aa5 -[SHKRemoteView initWithOptionsDictionary:] + 161 3 ShareKit 0x00007fff76396fbd 38-[SHKSharingService performWithItems:]_block_invoke_4 + 1347 4 libdispatch.dylib 0x00000001019eacfe _dispatch_call_block_and_release + 12 5 libdispatch.dylib 0x00000001019e2ddf _dispatch_client_callout + 8 6 libdispatch.dylib 0x00000001019eee59 _dispatch_main_queue_callback_4CF + 549 7
CoreFoundation 0x00007fff5515bc69 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 9 8 CoreFoundation 0x00007fff5511de4a __CFRunLoopRun + 2586 9 CoreFoundation 0x00007fff5511d1a3 CFRunLoopRunSpecific + 483 10 HIToolbox
0x00007fff54405d96 RunCurrentEventLoopInMode + 286 11 HIToolbox
0x00007fff54405b06 ReceiveNextEventCommon + 613 12 HIToolbox
0x00007fff54405884 _BlockUntilNextEventMatchingListInModeWithFilter + 64 13 AppKit 0x00007fff526b8a73 _DPSNextEvent + 2085 14 AppKit 0x00007fff52e4ee34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044 15 AppKit 0x00007fff526ad885 -[NSApplication run] + 764 16 AppKit 0x00007fff5267ca72 NSApplicationMain + 804 17 writer111
0x00000001002adf9d main + 13 18 libdyld.dylib
0x00007fff7d437015 start + 1 19 ???
0x0000000000000003 0x0 + 3 )

虽然效果很好,但这个警告消息让我很烦,我希望它会消失。

一个很简单的方法,却有这样一个警告。

let sharingService = NSSharingServicePicker(items: ["111"]);
sharingService.show(relativeTo: sender.bounds, of: sender, preferredEdge: .minX);

最佳答案

我不知道警告的原因,但我可以通过在新的运行循环上显示选择器来使其静音:

let sharingService = NSSharingServicePicker(items: ["111"]);
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now(), execute: {
sharingService.show(relativeTo: sender.bounds, of: sender, preferredEdge: .minX)
})

关于swift - 使用 NSSharingServicePicker 类时出现警告信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50152960/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com