When working on a multi-window AppKit app, how do you identify which window instance is associated with the current breakpoint?
The same question applies when using LLDB. If execution stops inside an object that can exist in more than one window, such as a shared NSViewController subclass, how do you know which window’s object you are currently inspecting?
Does Xcode provide a mechanism for showing the NSWindow associated with the current view, view controller or responder while debugging?
My current approach is to print object identities and compare them manually. For example, if several identical windows are open, I might print the current object and its window:
print(self, #function)
Then I interact with one window, make a note of the printed memory addresses in the console, switch to another window and compare the output. This works, but it feels manual.
I am not dealing with different window subclasses. The windows may be instances of the same class and may contain instances of the same view controller classes. I simply want an easier way to distinguish which window instance I am debugging.
Is there a recommended Xcode, LLDB or AppKit workflow for this?