NSCollectionViewMBS Error

I dont’ understand why I have this error?

The code:

Dim MyImageContainer as ImageContainer
// first time this item is shown
MyImageContainer = New ImageContainer
// place new item outside visible area

MyImageContainer.EmbedWithin(MainWindow, -10000, 10000, 320, 240)

Dim n As NSViewMBS = MyImageContainer.NSViewMBS

Trying to add the example to a new project. I copied all classes but still this error.
Last Xojo.

This could be something like Window vs. DesktopWindow.

What type is Main Window?
And what super type has ImageContainer?

Good point I had to move your example from ContainerControl to DesktopContainer. Now it’s working.