Error when clicking on TextField : CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them

Hello, I face an error everytime I want to interact with a TextField. The XCode debug area is showing :

CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them

There is no crash, and the text field is working fine.

I am developing for MacOS using a macbook pro Intel from 2019 with Sonoma 14.5 and Xcode 15.4 and I think that I noticed since the release of Sonoma. I was not particularly concerned by it but I noticed that interacting with the textField was leading to severe hang in my app, and micro-hang in the test app and I am wondering is these two issues could be related.

The message is easy to reproduce. Just create a new Project/Application/App using SwiftUI and add a TextField to the ContentView. When you start app, click or double click on the text field, enter a message and press enter.


import SwiftUI

struct ContentView: View {
    @State var value: String = ""
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)
            Text("Hello, world!")
            TextField(text: $value, 
                      label: {
                Text("Test")
            }
            )
        }
        .padding()
    }
}

Did you notice the same thing ? How I could solve it ?

Note : I already posted the problem on Swift forums but it was close because related to SwiftUI https://forums.swift.org/t/error-when-clicking-on-textfield-client-error-tuinsremoteviewcontroller-does-not-override-viewservicedidterminatewitherror-and-thus-cannot-react-to-catastrophic-errors-beyond-logging-them/72134/1

Thank you

Answered by DTS Engineer in 790190022

I've tried running the app you provided for macOS, and I'm unable to replicate the error you're encountering in the output window. The mention of 'TUINSRemoteViewController' from UIKit catches my eye, as it seems out of place in a SwiftUI application.

Could you please provide the following additional information?

  1. Full output window messages: It would be very helpful to see the complete error logs.

  2. Screenshots or gifs: If the error is visual, screenshots or gifs could aid in understanding the issue.

  3. Environmental details: What version of macOS are you using? Any specific Xcode settings or configurations?

  4. Test project with focused issue: It would be greatly appreciated if you could create a minimal test project that recreates the problem. To make it easier for me to investigate, please ensure that the project:

    • Is focused on the specific task or view where the error occurs.
    • Includes the necessary assets and dependencies.
    • Provides clear instructions on how to run the project and reproduce the error.

You can upload the project to a file-sharing service like GitHub or Dropbox and share the link here.

Thank you for your detailed assistance! The more information you provide, the faster I can help you resolve this issue.

struct ContentView: View {
    @State var value: String = ""
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)
            Text("Hello, world!")

            TextField(text: $value,
                                  label: {
                            Text("Test")
                        }
                        )

        }
        .padding()
    }
}

I see these messages in red in the Xcode console every time I click in a text field, even for a template app that only has one textfield. This is extremely annoying.

Getting the same error, using a TextField inside a List. Seems to occur when pressing enter

This is really easy for me to reproduce on an Intel Mac running Sonoma 14.6.1 and Xcode 15.4:

  1. Create a new default macOS app in Xcode using a Xib interface and Objective C
  2. Run the default macOS app
  3. Click the Help menu bar (note that the Search text field menu item is active)
  4. "Error when clicking on TextField..." appears in Xcode's log

I just filed Feedback FB14860396 (and I referenced this thread).

I'm seeing the same error when running the sample code at https://developer.apple.com/documentation/uikit/uikeycommand/navigating_an_app_s_user_interface_using_a_keyboard?language=objc (Xcode 15.4 , Designed for iPad). It appears when I select Search Results and hit tab key.

I'm seeing the same error with simple text fields. macOS Sonoma 14.6.1, Xcode 16.0 (16A242).

CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them

Sonoma 14.5, Xcode 16.0 (16A242d)

Pure SwiftUI application, MacOS (document-based), a single TextView with a binding instead of the template solution with added UndoManager functionality (which seems unnecessary).

The error does not happen every time:

– if I type in an existing document, it's fine; if I switch to Xcode and back to my app, the error appears. – if I create a new document and select the existing string, it's fine. If I create a second new document and select the string in that, I get the error. – if I switch between two dirty unsaved documents, I get the error.

and so on. I'm reasonably confident there are patterns to this, but I don't have the time or patience to try all of them.

Error when clicking on TextField : CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them
 
 
Q