Menu
  • HOME
  • TAGS

How to update NSCollectionViewItem when data model change?

xcode,swift,nsarraycontroller,nscollectionview,nscollectionviewitem

Bindings are built on top of Key-Value Observing. In order for a property in Swift to be KVO-compliant, it has to be marked dynamic. So, declare age as: dynamic public var age:Int ...

NSCollectionView does show nothing

cocoa,cocoa-bindings,nscollectionview,kvc,nscollectionviewitem

Their are basically 2 ways to work with NSCollectionView. 1 is to set the itemPrototype property and the other is to override newItemForRepresentedObject. The override method is more flexible and has the advantage that you using the technique below you can create the nscollectionviewitem in storyboard and all the outlets...

NSButton binding to NSCollectionViewItem: representedObject?

objective-c,swift,binding,nsbutton,nscollectionviewitem

You should bind to the NSCollectionViewItem instance which owns the view of which the button is a descendant. From what context are you creating the button and trying to bind it? Is this in a controller of the collection view? Or is it in the collection view item itself (which...

Popover segue from NSCollectionViewItem

objective-c,osx,cocoa,segue,nscollectionviewitem

Storyboards are relatively new to OS X. NSCollectionView seems to not get much love from Apple. There have been numerous reports that the combination of NSCollectionView and storyboards is buggy. So, you may be better off doing this the non-storyboard way. It may be simplest to connect the button to...