initWithSet
Initializes a new OSSet populated with the contents of another OSSet.
Declaration
virtual bool initWithSet(
const OSSet *set,
unsigned int capacity = 0);Parameters
- set:
A set whose contents will be placed in the new instance.
- capacity:
The initial storage capacity of the new set object. If 0, the capacity is set to the number of objects in
set; otherwisecapacitymust be greater than or equal to the number of objects inset.
Return Value
true on success, false on failure.
Overview
Not for general use. Use the static instance creation method withSet instead.
set must be non-NULL. If capacity is nonzero, it must be greater than or equal to count. The new set will grow as needed to accommodate more key-object pairs (unlikeCFMutableSet, for which the initial capacity is a hard limit).
The objects in set are retained for storage in the new set, not copied.
See Also
Miscellaneous
containsObjectcopyCollectionensureCapacityflushCollectionfreegetAnyObjectgetCapacitygetCapacityIncrementgetCountinitWithArrayinitWithCapacityinitWithObjectsisEqualTo(const OSMetaClassBase *)isEqualTo(const OSSet *)membermerge(const OSArray *)merge(const OSSet *)removeObjectserializesetCapacityIncrementsetObjectwithArraywithCapacitywithObjectswithSet