Important: The information in this document is obsolete and should not be used for new development.
NewCollection
You can use theNewCollectionfunction to create a new, empty collection object.
Collection NewCollection(void);
- function result
- A reference to the newly created collection object.
DESCRIPTION
TheNewCollectionfunction 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
NewCollectionfunction does not return an error code; it returnsnilif 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 theDisposeCollectionfunction, 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
CopyCollectionfunction, which is described in the previous section.To dispose of a collection object, use the
DisposeCollectionfunction, which is described in the next section.