Question

I have a NSArrayController bound to an array in one of my objects. I have a object inheriting from NSObject which is added to the nib file containing the NSArrayController. That object has a property called textureAtlas of type TextureAtlas (a type defined by myself). The type TextureAtlas defines a NSMutableArray property called textures.I am bounding to this texture array (so the path is something like 'textureAtlas.textures').

My problem is that whenever I select a new texture in the NSCollectionView, the other controls that are bound to some properties in the selection of the array controller doesnt change. In fact, the selectedIndex property of the NSArrayController is always zero. However, whenever I dynamically add a texture to my atlas, the texture is added correctly in the collection view. I can select textures in the Collection View (the selection border is drawn correctly around the last selected texture). Its just selectedIndex that does not change. What am I be missing?

Was it helpful?

Solution

I have solved the problem. Apparently you have to bind the selection indexes of the collection view and texture array controller. I don't understand why you have to do this. I though cocoa would do that automatically for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top