Table of Contents

count

 
- (NSUInteger)count
 

Returns the number of entries in a dictionary.

Return Value - NSUInteger

ObjC Sourcecode Example

    // ** Init dictionary with entries
    NSDictionary *myDictionary = [[NSDictionary alloc]initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil];
 
    int count = myDictionary.count;
 
    // ** Output dictionary count
    NSLog(@"myDictionary count: %i", myDictionary.count);

Output for this example code

2014-06-08 01:23:01.080 NSDictionary[3367:70b] myDictionary count: 2