J'ai un comportement incohérent dans mon application, où parfois un appel de dessin n'est pas reçu par MyView
, même après avoir suivi les mêmes étapes où il est reçu.Existe-t-il un moyen de dire ce qui provoque l'envoi d'un message -drawRect: à un NSView?
La chose est, dans la rétrospection pour drawRect
, il n'y a pas de cadres qui me disent ce qui se passe au sein de notre code qui provoque le message à envoyer
Voici un exemple backtrace (top 2 cadres ne pas matière):
2 MyApp 0x00000001000112a5 -[MyView drawRect:] + 1429
3 AppKit 0x00007fff8bfc87be -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:] + 1331
4 AppKit 0x00007fff8bfc8156 __46-[NSView(NSLayerKitGlue) drawLayer:inContext:]_block_invoke + 242
5 AppKit 0x00007fff8bfc7caf -[NSView(NSLayerKitGlue) _drawViewBackingLayer:inContext:drawingHandler:] + 2403
6 AppKit 0x00007fff8bfc7341 -[NSView(NSLayerKitGlue) drawLayer:inContext:] + 108
7 QuartzCore 0x00007fff88045b19 CABackingStoreUpdate_ + 3494
8 QuartzCore 0x00007fff88044d6d ___ZN2CA5Layer8display_Ev_block_invoke + 59
9 QuartzCore 0x00007fff88044759 _ZN2CA5Layer8display_Ev + 1565
10 AppKit 0x00007fff8bfc6318 _NSBackingLayerDisplay + 641
11 AppKit 0x00007fff8bfb8878 -[_NSViewBackingLayer display] + 818
12 QuartzCore 0x00007fff880364a5 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 603
13 QuartzCore 0x00007fff88035fcd _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 35
14 QuartzCore 0x00007fff880354a1 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
15 QuartzCore 0x00007fff880350ec _ZN2CA11Transaction6commitEv + 508
16 QuartzCore 0x00007fff88040977 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 71
17 CoreFoundation 0x00007fff88f3efc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
18 CoreFoundation 0x00007fff88f3ef37 __CFRunLoopDoObservers + 391
19 CoreFoundation 0x00007fff88f1de58 CFRunLoopRunSpecific + 328
20 HIToolbox 0x00007fff93726935 RunCurrentEventLoopInMode + 235
21 HIToolbox 0x00007fff9372676f ReceiveNextEventCommon + 432
22 HIToolbox 0x00007fff937265af _BlockUntilNextEventMatchingListInModeWithFilter + 71
23 AppKit 0x00007fff8be5fdf6 _DPSNextEvent + 1067
24 AppKit 0x00007fff8be5f226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
25 AppKit 0x00007fff8be53d80 -[NSApplication run] + 682
26 AppKit 0x00007fff8be1d368 NSApplicationMain + 1176
27 MyApp 0x000000010000d102 main + 34
28 libdyld.dylib 0x00007fff8ec5c5ad start + 1
Je veux juste savoir s'il est possible de voir exactement quel message/événement qui se passe que les résultats du -drawRect
, donc je peux voir pourquoi -drawRect
est parfois pas reçu
Notez que j'ai vu ce fil: How to tell what's causing drawRect to be called?, mais il ne répond pas à la question que j'ai