-layout not called after invoking -setNeedsLayout:YES

  • I'm overriding NSView's -layout method to arrange a grid of subviews.

    I call [gridView setNeedsLayout: YES] when a new subview is added,
    which usually results in -layout being called on gridView, but
    intermittently -layout is not called (resulting in incorrect subview
    positioning.) In contrast, I also call [gridView
    setNeedsUpdateConstraints: YES], which always results in
    -updateConstraints being called.

    I've verified that nothing is calling [gridView setNeedsLayout: NO] by
    overriding that method.

    What would prevent -layout from being called?
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today