Important: The information in this document is obsolete and should not be used for new development.
RemoveCollectionItem
You can use theRemoveCollectionItem
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
TheRemoveCollectionItem
function removes the item specified by thetag
andid
parameters from the collection referenced by thetarget
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
andid
parameters, this function returns acollectionItemNotFoundErr
result 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
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.