I found and modified a small POPOVER test calendar application last year from the internet. My modified application closed the POPOVER properly with Xcode 12.5.1 through Xcode 13.4.1. The test application currently fails with a “First Responder Error” when built with Xcode 14.2 and using Ventura 13.1.
- The POPOVER “fails to close” now when the USER selects a different POPOVER graphical calendar date, causing the application to crash.
- The application generates the following error message complete with the application’s built-in output comment code:
Monday, November 21, 2022
The NSDatePicker states the selected date to check :: 2022-11-21 20:20:56
checkThePopoverDateTimeStamp called
The selected date is before the current date ...
The NSDatePicker states the selected date to send = 2022-11-21 20:20:56
The checkThePopoverDateTimeStamp Function wants me to do something since the selected date is before the current date.
2022-12-12 20:21:43.964923-0700 PopOverDatePickerTest[6027:248144] [General] ERROR: Setting <NSDatePicker: 0x15b72aae0> as the first responder for window <NSWindow: 0x15b608ea0>, but it is in a different window (<_NSPopoverWindow: 0x11b605270>)! This would eventually crash when the view is freed. The first responder will be set to nil.
(
0 AppKit 0x00000001b695654c -[NSWindow _validateFirstResponder:] + 332
1 AppKit 0x00000001b69563b4 -[NSWindow _setFirstResponder:] + 28
2 AppKit 0x00000001b6a35934 -[NSWindow _realMakeFirstResponder:] + 328
3 AppKit 0x00000001b6bd0308 -[NSWindow _makeParentWindowHaveFirstResponder:] + 76
4 AppKit 0x00000001b6a44c00 -[NSWindow _selectFirstKeyView] + 544
5 AppKit 0x00000001b6a442c4 -[NSWindow _setUpFirstResponder] + 148
6 AppKit 0x00000001b6a41efc -[NSWindow _doWindowWillBeVisibleAsSheet:] + 108
7 AppKit 0x00000001b7124ad0 -[NSWindow _reallyDoOrderWindowAboveOrBelow:] + 1052
8 AppKit 0x00000001b7125494 -[NSWindow _reallyDoOrderWindow:] + 64
9 AppKit 0x00000001b7125c6c __27-[NSWindow _doOrderWindow:]_block_invoke.799 + 44
10 AppKit 0x00000001b69876cc NSPerformVisuallyAtomicChange + 108
11 AppKit 0x00000001b7125958 -[NSWindow _doOrderWindow:] + 876
12 AppKit 0x00000001b6b0ee94 _NSWindowRebuildOrderingGroupInternal + 504
13 AppKit 0x00000001b69876cc NSPerformVisuallyAtomicChange + 108
14 AppKit 0x00000001b6b0e688 -[NSWindow addChildWindow:ordered:] + 556
15 AppKit 0x00000001b6bccc7c -[NSPopover showRelativeToRect:ofView:preferredEdge:] + 1740
16 AppKit 0x00000001b6c5ccfc __53-[NSPopover showRelativeToRect:ofView:preferredEdge:]_block_invoke + 180
17 AppKit 0x00000001b6bd23b0 -[NSPopover _executeClosingBlock] + 52
18 AppKit 0x00000001b6bd217c -[NSPopover _finishClosingAndShouldNotify:] + 204
19 AppKit 0x00000001b6a47c78 -[NSWindow _windowTransformAnimationDidEnd:] + 388
20 AppKit 0x00000001b6b3c008 __48-[_NSWindowTransformAnimation _cleanUpAnimation]_block_invoke + 576
21 AppKit 0x00000001b6b3bd94 __48-[_NSWindowTransformAnimation _cleanUpAnimation]_block_invoke_2 + 64
22 AppKit 0x00000001b72bb978 ___NSMainRunLoopPerformBlockInModes_block_invoke + 44
23 CoreFoundation 0x00000001b36ed5cc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
24 CoreFoundation 0x00000001b36ed4e0 __CFRunLoopDoBlocks + 368
25 CoreFoundation 0x00000001b36ec32c __CFRunLoopRun + 820
26 CoreFoundation 0x00000001b36eb8a4 CFRunLoopRunSpecific + 612
27 HIToolbox 0x00000001bcd5f3bc RunCurrentEventLoopInMode + 292
28 HIToolbox 0x00000001bcd5f200 ReceiveNextEventCommon + 672
29 HIToolbox 0x00000001bcd5ef48 _BlockUntilNextEventMatchingListInModeWithFilter + 72
30 AppKit 0x00000001b6944630 _DPSNextEvent + 632
31 AppKit 0x00000001b69437c0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
32 AppKit 0x00000001b6937bf0 -[NSApplication run] + 464
33 AppKit 0x00000001b690f058 NSApplicationMain + 880
34 PopOverDatePickerTest 0x0000000100903b10 main + 12
35 dyld 0x00000001b32e3e50 start + 2544
)
For the moment, I do not understand, nor can I determine what changed within Xcode 14.1 to cause this short circuit to occur. If this issue happens to be a permanent change within Xcode 14, then I must redesign the test application code to function without the POPOVER calendar within my main application. Unfortunately, this issue defeats my current main application design purpose to allow the USER to properly select an alternate date in the POPOVER’s graphical calendar.
I placed the test application code within my public GitHub location. Please contact me at ... (jim dot kitchen at shaw dot ca) for access to the file’s GitHub public location …
Again, thank you for any interest, suggestions, and assistance you might employ in a review … :]
Best regards,
jim_k