Important: The information in this document is obsolete and should not be used for new development.
CopyCollection
You use theCopyCollection
function to create a copy of an existing collection.
Collection CopyCollection(Collection source, Collection target);
source
- A reference to the collection object you want to copy.
target
- A reference to a collection object to contain the copied collection items. You may provide
nil
for this parameter to request that the Collection Manager create a new collection object to hold the copied information.- function result
- A reference to the collection object containing the copied information.
DESCRIPTION
TheCopyCollection
function copies all of the information (except the owner count and exception procedure) from the collection object referenced by thesource
parameter into the collection object referenced by thetarget
parameter.If you specify
nil
for thetarget
parameter, this function creates a new collection object to copy the information into. (This function does not return an error code; it returnsnil
if it cannot create a new collection object.)In either case, this function returns a reference to the collection object containing the copied information.
SEE ALSO
For general information about QuickDraw GX objects, see the chapter "Introduction to QuickDraw GX Objects" in Inside Macintosh: QuickDraw GX Objects.For examples using this function, see "Cloning or Copying a Collection" on page 5-14.
To clone a collection object, use the
CloneCollection
function, which is described on page 5-56.