title: How to retrieve String from NSDictionary in objective C?
body: <p>I am trying to retrieve the value for a key in a NSDictionary.  The dictionary has been initialised with key value pairs both of type string.  The trouble is, I cannot seem to retrieve the value with I call objectForKey or valueForKey.</p>
  
  <p>I am able to iterate over the dictionary and print both keys and values.</p>
  
  <p>Can someone point out where im going wrong? Here is my code...</p>
  
  <pre><code>//Set up dictionary with options
  keys = [NSArray arrayWithObjects:@"red", @"blue", nil];
  values = [NSArray arrayWithObjects:@"1.7", @"2.8", nil];
  
  conversionOptions = [NSDictionary dictionaryWithObject:values 
                                                  forKey:keys];
  </code></pre>
  
  <p>Then this is called on the select row in a picker</p>
  
  <pre><code>NSLog(@"... %@", [keys objectAtIndex:row]);       //prints out the key
  NSString *theString = [keys objectAtIndex:row];   //save it as a string
  NSLog(@"The string is... %@", theString);         //print it out to make sure im not going crazy
  
  NSLog(@"the value is : %@",[conversionOptions objectForKey:theString]); // I just get NULL here
  //NSLog(@"the value is : %@",[conversionOptions valueForKey:theString]); // This doesn't work either, I just get NULL
  </code></pre>