NSCollectionViewItem Class Reference
| Inherits from | |
| Conforms to | NSCopying NSCoding (NSViewController) NSCoding (NSResponder) NSObject (NSObject) NSEditor (Informal Protocol) (NSViewController) NSEditorRegistration (Informal Protocol) (NSViewController) |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.5 and later. |
| Companion guide | |
| Declared in | NSCollectionView.h |
Overview
The NSCollectionViewItem class is a view controller subclass that manages the relationship between a compound view and the model object that provides its content.
New instances of NSCollectionViewItem are created using the NSCollectionView method newItemForRepresentedObject:. See NSCollectionView Class Reference for details.
Tasks
Getting and Setting Image and Text Fields
Managing the Selection
-
selectedproperty
Parent Collection View
-
collectionViewproperty
Dragging Components
-
draggingImageComponentsproperty
Setting the Represented Object
-
– representedObjectAvailable in OS X v10.5 through OS X v10.5 -
– setRepresentedObject:Available in OS X v10.5 through OS X v10.5
Modifying the View
-
– setView:Available in OS X v10.5 through OS X v10.5 -
– viewAvailable in OS X v10.5 through OS X v10.5
Properties
collectionView
Returns the receiver’s collection view. (read-only)
Discussion
This method return’s the receiver’s collection view.
Availability
- Available in OS X v10.7 and later.
Declared In
NSCollectionView.hdraggingImageComponents
Dragging images for multi-image drag and drop support. (read-only)
Discussion
The component frames are relative to a coordinate system that has its origin at the bottom left, so you need to take into account the flipped state of your view when computing the component frames.
This methods can be subclassed and overridden to provide a custom set of NSDraggingImageComponent objects to create the drag image.
The default implementation will return an array of up to two NSDraggingImageComponent instances -- one for the imageView and another for the textField (if not nil).
Availability
- Available in OS X v10.7 and later.
Declared In
NSCollectionView.himageView
An image view to display an image in the collection item.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
NSCollectionView.hselected
Specifies if the collection item is selected.
Discussion
YES if the receiver is selected, otherwise NO.
Availability
- Available in OS X v10.7 and later.
Declared In
NSCollectionView.htextField
A text field to display a string in the collection item.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
NSCollectionView.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-06-11)