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 / Creating and Disposing of Collection Objects


NewCollection

You can use the NewCollection function to create a new, empty collection object.

Collection NewCollection(void);
function result
A reference to the newly created collection object.
DESCRIPTION
The NewCollection 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 returns nil 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 the DisposeCollection 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996