23

After converting my SwiftUI project to Catalyst I get this strange error message on the console:

[API] cannot add handler to 3 from 3 - dropping

This happens when a view is scrolled, even in release mode, and quite a lot, probably every frame. It seems the whole logging slows the app down.

I am sorry to be so unspecific, I just don't know where to start from here. (Except of filing a bug of course)

Has anyone had a similar experience? Where and when? Is there maybe a workaround?

There is a thread in the Apple Forum, which is not solving the problem at all:

https://developer.apple.com/forums/thread/719267

I have nothing found here nor by google.

Xcode is 14.2 macOS 13.2.1

heiko
  • 1,268
  • 1
  • 12
  • 20
  • Is anything broken? why do you worry about this? – timbre timbre Mar 13 '23 at 14:15
  • 1
    "Is anything broken?" That's the question I am worried about. Is there anything that can be done on my side? --- "Why do you worry about this?" Well, at least the message is spamming the device logs at 60 fps when scrolling, even when compiled in release mode. So, I assume, it affects performance in some way... – heiko Mar 22 '23 at 10:15
  • Well, error messages are only meaningful if you know their context. In this case we don't know the context (since it's coming from some internal Apple's API). It could be a silly debug message, someone forgot to turn off, or a bug. Either way there's nothing you can do about it, except for submitting a bug to apple. But if you actually have some issue, this could be a red herring, which makes you concentrate on this instead of the actual problem (if you have one). – timbre timbre Mar 22 '23 at 13:55
  • same question and zero idea how to answer this one nor make the question more precise. – Dan Rosenstark Apr 10 '23 at 19:01
  • 1
    I'm seeing this in a UIKit Objective-C app so it's not specific to SwiftUI. Happens to me in a few different table view controllers while scrolling. – HangarRash May 09 '23 at 04:33
  • 2
    I have this in a UIKit using Swift 4.2… This may not have been happening in Xcode 14.0… for me. – benc May 12 '23 at 05:16
  • For me the issue is caused by a TextField. This can be bound to either String or Float and NumberFormatter. It gets spammed when the value is changed, e.g. by a Slider, and causes bad performance. Removing the TextField hides the message. With 18 controls on the screen the app is crawling. @State var a: Float = 0 TextField("1-99", value: $a, formatter: NumberFormatter()) Slider(value: $a, in: 0...99, step: 1) – George Valkov Jul 16 '23 at 14:53
  • I was seeing this in a [SplitView](https://github.com/stevengharris/SplitView) implementation I did, when running with Mac Catalyst. I came to the conclusion it is just a bit of harmless but annoying logging that was left in by mistake. I can report that it is gone as of XCode 15 Beta 6 running on MacOS 14 Sonoma Beta 5. – Steve Harris Aug 16 '23 at 21:48

0 Answers0