In my application I take input from user and store it in NSMutableDictionary and Fetch result successfully.
But I am little confused about the output print on console. It’s not in an order.
What is reason behind this output?
Thanks

I use the following code to store input from textField and print it on Console.
-(IBAction)doneButtonClicked:(id)sender
{
NSArray *arr=[NSArray arrayWithObjects:@"firstName",@"middleName",@"lastName",@"address",@"email",@"phone",nil];
DataClass *obj=[DataClass getInstance];
obj.personelInfo=[NSMutableDictionary dictionary];
for (int a=1; a<=personelInfoCounter; a++) {
UITextField *textField = (UITextField*)[self.view viewWithTag:a];
NSString *fieldValue = textField.text;
if(fieldValue != nil)
{
[obj.personelInfo setObject:fieldValue forKey:[arr objectAtIndex:a-1]];
}
else
{
[obj.personelInfo setObject:@"" forKey:[arr objectAtIndex:a-1]];
}
}
NSLog(@"Final value of Personal Info Dictionary is ----------------------------------:");
for (id key in obj.personelInfo) {
NSLog(@"%@ , %@", key, [obj.personelInfo objectForKey:key]);
}
}
And the output on console is

NSDictionaryandNSMutableDictionarydon’t maintain the order of the things you put in them. It’s undefined what order you’ll get when you enumerate a dictionary.