This question is mainly just a point of curiosity and education.
I'm working on one of my first macOS apps, and I see I can check NSApplication.shared.windows to get a list of all the application's windows. Most of the time, this list contains the windows I've programmed which are in memory. Sometimes, though, it also contains two instances of NSMenuWindowManagerWindow. This doesn't appear to be a documented type, and I'm inferring I'm seeing evidence of something NSApplication or the system is doing to help deliver or render some kind of standard application behaviour. I'm wondering whether any macOS gurus (or engineers) can shine some light on it.
Post not yet marked as solved
Erratic behaviour developing a game on the Mac. I'm using and building for the current (non-beta) version of everything as of this date: macOS Catalina 10.15.6, Xcode 11.6.
I can build and run and test the game normally, until for whatever unknown reason, the game begins freezing every time at the point I try to authenticate. I've narrowed it down to this by using the following bare-bones invocation just after app launch completes:
print("A")
GKLocalPlayer.local.authenticateHandler = { vc, error in
print(vc)
print(error)
}
print("B")
Sure enough, "A" is printed, and then execution stops. Activity Monitor lists the app as "not responding," and I have to force quit and restart the Mac before I can successfully run and test the app again. (Or if I'm not interested in testing Game Center features, I can comment out this authentication block and everything works fine.) No problems with any of this when testing the same project built for iOS.
Has anyone got any notion of what could be happening here?
I'm still just feeling out SwiftUI, so maybe someone can tell me if I'm missing something obvious.My Pickers on Apple Watch always seem to crash my app when scrolling all the way up to the first option, then attempting to scroll down even a frame. The console output seems familiar from pre-SwiftUI:*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan].I've reduced this to the simplest SwiftUI Picker I can imagine, and it still crashes.struct TestPicker: View {
@State var test: Int = 1
var body: some View {
Picker("Pick!", selection: $test) {
ForEach(1...3, id: \.self) { value in
Text(String(value))
}
}
}
}