Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 5 - Collection Manager / Collection Manager Reference
Functions / Removing Items From a Collection


RemoveCollectionItem

You can use the RemoveCollectionItem function to remove an item from a collection given the item's associated collection tag and collection ID.

OSErr RemoveCollectionItem (Collection target,
                            CollectionTag tag, long id);
target
A reference to the collection object from which you want to remove the item.
tag
The collection tag associated with the item you want to remove.
id
The collection ID associated with the item you want to remove.
DESCRIPTION
The RemoveCollectionItem function removes the item specified by the tag and id parameters from the collection referenced by the target parameter. This function removes the specified item even if its lock attribute is set.

If the target collection does not contain an item whose collection tag and collection ID match the values in the tag and id parameters, this function returns a collectionItemNotFoundErr result code.

RESULT CODES
collectionItemNotFoundErr-5751Can't locate item.
SEE ALSO
For information about collection items, see "Collection Items" beginning on page 5-8.

For examples using this function, see "Removing Items From a Collection" beginning on page 5-30.

To remove a collection item using the item's index (rather than the item's tag and ID), use the RemoveIndexedCollectionItem function, described in the next section.

To replace an item in a collection, use the functions described in "Adding and Replacing Items in a Collection" beginning on page 5-62.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996