title: Setting and getting BOOL values in NSDictionary
body: <p>I need a dictionary of Strings that point to boolean values.</p>
  
  <p>I have an NSDictionary toolStates that I create like this</p>
  
  <pre><code>NSArray *keys = [NSArray arrayWithObjects:@"X", @"Y", nil];
  NSArray *isActive = [NSArray arrayWithObjects:[NSNumber numberWithBool:NO], [NSNumber numberWithBool:YES], nil];
  toolStates = [NSDictionary dictionaryWithObjects:isActive forKeys:keys];
  </code></pre>
  
  <p>elsewhere in my class, I am trying to retrieve and compare the booean value like this</p>
  
  <pre><code>if ([toolStates valueForKey: @"X"] == [NSNumber numberWithBool:NO]) NSLog(@"%s", "X = NO");
  </code></pre>
  
  <p>I know that both portions of code are running, but I get a "EXC_BAD_ACCESS" error on the if statement with the output: </p>
  
  <pre><code>&lt;Error&gt;: CGAffineTransformInvert: singular matrix.
  </code></pre>
  
  <p>Is there something wrong with the comparison?</p>
  
  <p>I get the same error when I try this:</p>
  
  <pre><code>[toolStates setValue:[NSNumber numberWithBool:YES] forKey:@"X"];
  </code></pre>