Questions tagged [nscollectionviewitem]
101 questions
33
votes
9 answers
Selection Highlight in NSCollectionView
I have a working NSCollectionView with one minor, but critical, exception. Getting and highlighting the selected item within the collection.
I've had all this working prior to Snow Leopard, but something appears to have changed and I can't quite…

Hooligancat
- 3,588
- 1
- 37
- 55
21
votes
8 answers
Cocoa - Where is the link between a NSCollectionView and a NSCollectionViewItem? Xcode 6 Bug?
When you drag a NSCollectionView to a view, a NSCollectionViewItem appears on the storyboard, floating around.
Imagine I drag several NScollectionViews to the same view. I will have a bunch of NSCollectionViewItems. How a collection view knows…

Duck
- 34,902
- 47
- 248
- 470
10
votes
1 answer
10.11 NSCollectionView - determining cell size dynamically
AppKit Release Notes for OS X v10.11 suggests that collection view items can be resized on a per-item basis:
Item size can be determined globally for all of a CollectionView’s items (by setting an NSCollectionViewFlowLayout’s “itemSize” property),…

Etan
- 17,014
- 17
- 89
- 148
8
votes
5 answers
Get index of a view inside a NSCollectionView?
I've developed an app for Mac OS X Lion using its new view-based NSTableView, but as I want to port the whole app to Snow Leopard I'm trying to figure out the best way to emulate such a tableview. So far I've created a NSCollectionView and…

Nickkk
- 2,261
- 1
- 25
- 34
8
votes
1 answer
Using NSCollectionView without bindings
Is there a way to use an NSCollectionView without bindings?

Radu Paise
- 285
- 1
- 6
- 16
7
votes
1 answer
NSCollectionView draws nothing
I'm trying to set up an NSCollectionView (I have done this successfully in the past, but for some reason it fails this time).
I have a model class called "TestModel", and it has an NSString property that just returns a string (just for testing…

indragie
- 18,002
- 16
- 95
- 164
6
votes
2 answers
NSCollectionViewItem double-click action?
How do I set an action for when a user double clicks an NSCollectionViewItem. NSTableView, for example, has the setDoubleAction method. Is there something similar for NSCollectionView?
Thanks

indragie
- 18,002
- 16
- 95
- 164
5
votes
1 answer
NSCollectionViewItem never instantiate
I'm a bit lost here:
I created a button acting like a colorPicker: clicking on it shows a collectionView in a popover.
I first did it with a nib fil containing a view + the collectionView (embedded in as scrollView + a clipView).
The stuff works…

Joshua
- 147
- 1
- 12
4
votes
1 answer
NSCollectionView, Swift 4 - Cannot invoke "register"
Can anyone suggest how to solve this NSCollectionView issue? Converted from Swift 3 to Swift 4 and magic started happening :)
Code:
let item = NSNib(nibNamed: NSNib.Name(rawValue: "MACollectionViewItem"), bundle: nil)
collectionView.register(item,…

spacecash21
- 1,331
- 1
- 19
- 41
4
votes
2 answers
How to use NSCollectionViewItem without subclassing it?
I am writing a very simple macOS application that I'd like to show a few images in a collection view. I don't need any special behavior for how they are displayed. The docs for NSCollectionViewItem say:
The default implementation of this class…

user1118321
- 25,567
- 4
- 55
- 86
4
votes
0 answers
Link NSCollectionView to NSCollectionViewItem in NSStoryboard
In the storyboard, I have an NSCollectionView inside an View Controller Scene, and an Collection View Item Scene.
However, I have no idea how to link these two. I can't see anything in Interface Builder to link them.
The NSCollectionView class…

Dieter Baron
- 101
- 3
4
votes
0 answers
NSCollectionView does not change background colors when select or deselect 'Use Alternating Colors'
Right now I am working on a Startup Window for my document based application. The window's purpose is to give the user something visual to start with, instead of the menu bar.
The window contains a NSCollectionView whose purpose is to show recent…

Tom Vos
- 410
- 1
- 5
- 13
3
votes
0 answers
Conditionally set NSCollectionViewItem's view
I have a NSCollectionView that binds to a array controller. This array controller contains a list of NSDictionary.
The items are of two types - defined in the dictionary - called header and item. If the type is header I will display a different view…

Christoffer
- 25,035
- 18
- 53
- 77
3
votes
3 answers
Binding to NSCollectionViewItem crashes Xcode
Using XCode 4.1 I've come across a crash whenever I try to use a CollectionView.
These are the steps I'm doing:
From a new project, edit the MainMenu.nib file.
Add an NSCollectionView to the window, which also adds a Collection View
Item, and a new…

iain
- 5,660
- 1
- 30
- 51
3
votes
2 answers
How to implement a NSCollectionView with centered items which have self-resizing margins?
Suppose that I have one item in the collection view, the item will be centered in the collection view on the first row.
And with multiple items, all these items will be distributed horizontally in the collection view with appropriate spacing between…

mrahmiao
- 1,291
- 1
- 10
- 22