Instance Method

newItemForRepresentedObject:

Returns the collection view item that is used for the specified object.

Declaration

- (NSCollectionViewItem *)newItemForRepresentedObject:(id)object;

Parameters

object

The content object that the collection view item will represent.

Return Value

An initialized collection view item with the specified object and the appropriate view set. The collection view item should not be autoreleased.

Discussion

Whenever possible, register classes or nib files for your items instead of using this property. For more information, see Creating Collection View Items.

Subclasses can override this method if the collection view items are not generated from a prototype or if the prototype view needs to be modified. The subclass is responsible for setting the view and representedObject of the new collection view item.

See Also

Legacy Collection View Support

itemPrototype

The receiver’s collection view item prototype.

Deprecated
selectionIndexes

The indexes of the currently selected items.

maxNumberOfRows

The maximum number of rows that the collection view displays.

Deprecated
maxNumberOfColumns

The maximum number of columns that the collection view displays.

Deprecated
minItemSize

The minimum size (in points) of items in the collection view grid.

Deprecated
maxItemSize

The maximum size (in points) of items in the collection view grid.

Deprecated
- itemAtIndex:

Returns the collection view item for the represented object at the specified index.

- frameForItemAtIndex:

Returns the frame of the collection view item at the specified index.

- frameForItemAtIndex:withNumberOfItems:

Returns the frame of an item based on the number of items in the collection view.

- draggingImageForItemsAtIndexes:withEvent:offset:

This method computes and returns an image to use for dragging.