Important: The information in this document is obsolete and should not be used for new development.
NewCollection
You can use theNewCollection
function to create a new, empty collection object.
Collection NewCollection(void);
- function result
- A reference to the newly created collection object.
DESCRIPTION
TheNewCollection
function allocates memory for a new collection object, initializes it, and returns a reference to it as the function result. The new collection contains no items and has an owner count of 1.The
NewCollection
function does not return an error code; it returnsnil
if it cannot create a new collection object.SPECIAL CONSIDERATIONS
You are responsible for disposing of collection objects that you create with this function when you no longer need them. See the next section, which describes theDisposeCollection
function, for information about disposing of collection objects.SEE ALSO
For general information about QuickDraw GX objects, see the chapter "Introduction to QuickDraw GX" in Inside Macintosh: QuickDraw GX Objects.For examples using this function, see "Creating or Disposing of a Collection" beginning on page 5-14 and "Adding Items to a Collection" beginning on page 5-17.
To create a copy of an existing collection object, use the
CopyCollection
function, which is described in the previous section.To dispose of a collection object, use the
DisposeCollection
function, which is described in the next section.