Instance Method

objectEnumerator

Returns an enumerator object that lets you access each object in the hash table.

Declaration

- (NSEnumerator<ObjectType> *)objectEnumerator;

Return Value

An enumerator object that lets you access each object in the hash table.

Discussion

The following code fragment illustrates how you can use this method.

NSEnumerator *enumerator = [myHashTable objectEnumerator];
id value;
 
while ((value = [enumerator nextObject])) {
    /* code that acts on the hash table's values */
}

Special Considerations

It is more efficient to use the fast enumeration protocol (see NSFastEnumeration).

See Also

Accessing Content

anyObject

One of the objects in the hash table.

allObjects

The hash table’s members.

setRepresentation

A set that contains the hash table’s members.

count

The number of elements in the hash table.

- containsObject:

Returns a Boolean value that indicates whether the hash table contains a given object.

- member:

Determines whether the hash table contains a given object, and returns that object if it is present