Important: The information in this document is obsolete and should not be used for new development.
RemoveCollectionItem
You can use theRemoveCollectionItemfunction 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
TheRemoveCollectionItemfunction removes the item specified by thetagandidparameters from the collection referenced by thetargetparameter. 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
tagandidparameters, this function returns acollectionItemNotFoundErrresult code.RESULT CODES
collectionItemNotFoundErr -5751 Can'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
RemoveIndexedCollectionItemfunction, 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.