Table of Contents

allKeys

 
- (NSArray *)allKeys
 

Returns a new array containing the dictionary’s keys, or an empty array if the dictionary has no entries.

Return Value - NSArray

ObjC Sourcecode Example

    // ** Init dictionary with entries
    NSDictionary *myDictionary = [[NSDictionary alloc]initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil];
 
    NSArray *keysArray = [myDictionary allKeys];
 
    // ** Output dictionary keys
    NSLog(@"myDictionary all keys: %@", keysArray);

Output for this example code

2014-06-08 01:47:29.180 NSDictionary[3462:70b] myDictionary all keys: (
    key2,
    key1
)