What is PBItemCollectionServicer?

后端 未结 6 971
孤街浪徒
孤街浪徒 2020-12-30 00:48

I searched SO ,find nothing about PBItemCollectionServicer.

My question become form my app crash(because of memory rise violently), then print:

6条回答
  •  独厮守ぢ
    2020-12-30 01:12

    Firstly, this is not an answer to the question. And I failed to find one. It's just some information I think may be helpful for someone who can dig into this and find an answer.

    I was tinkering with the copy(_:), cut(_:) and paste(_:) functions of UITextField. Almost every time I did copy/cut/paste in in field, the Xcode gave this message:

    2020-07-17 15:45:38.796510+0800 MyApp[3062:1763915] [general] Connection to daemon was invalidated
    2020-07-17 15:45:54.179188+0800 MyApp[3062:1763859] PBItemCollectionServicer connection disconnected.
    2020-07-17 15:46:53.097783+0800 MyApp[3062:1763859] PBItemCollectionServicer connection disconnected.
    2020-07-17 15:46:57.180499+0800 MyApp[3062:1763859] PBItemCollectionServicer connection disconnected.
    2020-07-17 15:48:34.901502+0800 MyApp[3062:1764656] PBItemCollectionServicer connection disconnected.
    

    The only relevant code is an extension to UITextField:

    extension UITextField {
        open override func copy(_ sender: Any?) {
            print(sender)
            print(text)
        }
    
        open override func paste(_ sender: Any?) {
            print(sender)
            print(text)
        }
        
        open override func cut(_ sender: Any?) {
            print(sender)
            print(text)
        }
    }
    

    And none of them was called. How weird. Then I commented out this extension, and to my surprise, Xcode still gave the exactly same message. Anyway, after I searched here and there, I found this in Apple Developer Forums, which is discussion about the failure of UIDropInteraction with the same error message. As all the other answers mostly talked about UIPasteboard, I think it is necessary to put it here although it doesn't contain a solution or answer.

    I tried running on both Simulator(13.5) and device(13.4.1), with Xcode 11.5, and got the same error message.

提交回复
热议问题