enumeratingSubviewsCount error

I get many crash logs from my mac app as below:

Application Specific Information:
assertion failure: "(self)->_enumeratingSubviewsCount < ((1 << 6) - 1)" -> %lld

I know literal meaning when a super view have subviews more than 2 to the 6th power, which is 128.

However, when I make a test app, which addSuviews to 200. But it doesn't crash. The test demo code show below

   for (int i = 0; i < 200; i++) {
    NSView *view = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 20, 20)];
    [self.window.contentView addSubview:view];
  }

Anybody know how to fix this problem. Thanks.
Could you show the code that crashes ?

I found a reference to the same issu (that's in french)e:
https ://forum.macbidouille. com/index.php?showtopic=418944&st=0&p=4357981&#entry4357981

It seems to be linked to /System/Library/PreferencePanes/Dock.prefPane

Note: Why would you have to add so many levels of subviews ?
2 to the 6th power is 64.
This is a bug. I don't want to add so many levels of subviews. The detail of crash thread show as below:

Thread 9 Crashed:: Dispatch queue: com.apple.root.user-interactive-qos
0 libsystem_kernel.dylib 0x00007fff73d39ad6 __abort_with_payload + 10
1 libsystem_kernel.dylib 0x00007fff73d3b3df abort_with_payload_wrapper_internal + 80
2 libsystem_kernel.dylib 0x00007fff73d3b411 abort_with_payload + 9
3 libsystem_c.dylib 0x00007fff73ca680b _os_crash_fmt.cold.1 + 55
4 libsystem_c.dylib 0x00007fff73c39e62 _os_crash_fmt + 154
5 com.apple.AppKit 0x00007fff37011e28 NSViewSendViewWillDrawToSubviews + 949
6 com.apple.AppKit 0x00007fff37011a49 _NSViewWillDraw + 45
7 com.apple.AppKit 0x00007fff3701169b -[_NSViewBackingLayer display] + 68
8 com.apple.QuartzCore 0x00007fff457cf1fd CA::Layer::display_if_needed(CA::Transaction*) + 757
9 com.apple.QuartzCore 0x00007fff457ad4b6 CA::Context::commit_transaction(CA::Transaction*, double) + 334
10 com.apple.QuartzCore 0x00007fff457ac0a0 CA::Transaction::commit() + 644
11 com.apple.AppKit 0x00007fff36f7eb74 NSPerformVisuallyAtomicChange + 154
12 com.apple.AppKit 0x00007fff371cda17 -[NSAnimation(NSInternal) _advanceTimeWithDisplayLink:] + 172
13 com.apple.AppKit 0x00007fff3712b624 -[NSScreenDisplayLink _fire] + 180
14 com.apple.AppKit 0x00007fff37878c62 ___NSRunLoopTimerCreateWithHandler_block_invoke + 34
15 com.apple.CoreFoundation 0x00007fff39cde4d8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
16 com.apple.CoreFoundation 0x00007fff39cde03e __CFRunLoopDoTimer + 872
17 com.apple.CoreFoundation 0x00007fff39cddb29 __CFRunLoopDoTimers + 322
18 com.apple.CoreFoundation 0x00007fff39cc277d __CFRunLoopRun + 1885
19 com.apple.CoreFoundation 0x00007fff39cc19c3 CFRunLoopRunSpecific + 466
20 com.apple.Foundation 0x00007fff3c37d1c8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
21 com.apple.AppKit 0x00007fff371cd930 -[NSAnimation(NSInternal) _runBlocking] + 344
22 com.apple.AppKit 0x00007fff371cd60d __42-[NSAnimation(NSInternal) _runInNewThread]_block_invoke + 97
23 libdispatch.dylib 0x00007fff73b7e6c4 _dispatch_call_block_and_release + 12
24 libdispatch.dylib 0x00007fff73b7f658 _dispatch_client_callout + 8
25 libdispatch.dylib 0x00007fff73b8daa8 _dispatch_root_queue_drain + 663
26 libdispatch.dylib 0x00007fff73b8e097 _dispatch_worker_thread2 + 92
27 libsystem_pthread.dylib 0x00007fff73ddd9f7 _pthread_wqthread + 220
28 libsystem_pthread.dylib 0x00007fff73ddcb77 start_wqthread + 15
Could you detail the context when it crashes ?
  • MacOS version

  • Xcode version

  • use case

And please show the code and exact line of crash.

If you are sure it is a system bug (why ?), you should file a bug report.

I get many crash logs from my mac app as below

Can you post an Apple crash report for this? Use the text attachment feature (the paperclip icon) to avoid clogging up the timeline.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
enumeratingSubviewsCount error
 
 
Q