Debugging Nested NSCollectionViews

I am not sure how to start debugging this problem.

I have an NSCollectionView whose representation of the NSCollectionViewItem prototype itself contains an NSCollectionView (as well as an NSArrayController to provide content to this level 2 collection view). Both levels of collection viewing work fine when the top level view is at the main end.

However, when I copy / paste the view (and reconnect all the corresponding bindings) to the new nib, which is loaded with loadNibNamed:owner: 2nd level view is displayed, but not the top level. empty.

After some investigation, I found that myArrayController.arrangedObjects.@count indeed 0. HOWEVER, NSArray, the controller is connected to (File Owner representedObject.quizzes ), when requested by .@count , returns 2.

quizzes should really return 2 as I did [testCategoryA setQuizzes:[NSArray arrayWithObjects:testQuizA1,testQuizA2,nil]]; . I tested the quiz setup before the feathers are loaded and after. In both cases, the situation is the same.

So, in conclusion, I have two levels of viewing collections with 2 levels of array controllers. The top level always works. But the second level is interrupted whenever the top level is not in the main nib file. And it seems to me that the part of the second level that breaks down is the binding of the array controller.

I don’t even know how to start debugging in this messy mess of knives. Suggestions?

+4
source share
1 answer

It seems that your polls array either does not send KVO notifications or edits it in a non-KVO-compatible way (ie, "edits the array behind the back of the controller").

Additionally, you might want to check Indexed access methods for your survey array for performance reasons.

+1
source

Source: https://habr.com/ru/post/1300353/


All Articles