NSMutableDictionary is a collection object similar to an array (NSArray).  However an NSArray is an ordered list you access using an index value.  Dictionary objects are not ordered and instead each object has a key (usually a string) which you use to access it.

If you add an object to a dictionary using an existing key value, the new object replaces the existing object.

Creating A Unique Key


	//Generate a unique ID
	CFUUIDRef newUniqueId = CFUUIDCreate (kCFAllocatorDefault);
	CFStringRef newUniqueIdString = CFUUIDCreateString(kCFAllocatorDefault, newUniqueId);
	[MyStringVariable:(NSString *)newUniqueIdString];	//Use key here
	CFRelease(newUniqueIdString);
	CFRelease(newUniqueId);

Creating Dictionary Example


    NSMutableDictionary *recordSettings = [[[NSMutableDictionary alloc] init] autorelease];

    [recordSettings setValue:[NSNumber numberWithInteger:kAudioFormatAppleLossless]
                      forKey:AVFormatIDKey];

    [recordSettings setValue:[NSNumber numberWithFloat:44100.0f]
                      forKey:AVSampleRateKey];

    [recordSettings setValue:[NSNumber numberWithInteger:1]
                      forKey:AVNumberOfChannelsKey];

    [recordSettings setValue:[NSNumber numberWithInteger:AVAudioQualityMedium]
                      forKey:AVEncoderAudioQualityKey];