Trouble creating dictionary

2011-09-27 Thread Dale Satterfield
I have the following code which creates two arrays of 97 elements each, then creates an NSDictionary. However, the dictionary only has 30 elements in it, and reports no errors during creation. None of the keys should be a duplicate . tzKeys = [NSArray

Re: Trouble creating dictionary

2011-09-27 Thread Quincey Morris
On Sep 27, 2011, at 18:21 , Dale Satterfield wrote: tzDict = [NSDictionary dictionaryWithObjects:tzKeys forKeys:tzValues]; Don't you mean: tzDict = [NSDictionary dictionaryWithObjects:tzValues forKeys:tzKeys]; ___ Cocoa-dev mailing

Re: Trouble creating dictionary

2011-09-27 Thread Graham Cox
On 28/09/2011, at 11:21 AM, Dale Satterfield wrote: tzDict = [NSDictionary dictionaryWithObjects:tzKeys forKeys:tzValues]; You've transposed the values and the keys here, and since the values are not unique, you end up with only 30 unique keys (which are really the values). --Graham