Using SKNode objects for keys in NSDictionary? (Compare issue)
<p>Objective-C</p>

<p>Consider this code:</p>

<pre><code>SKNode *n1 = [SKNode new];
SKNode *n2 = [SKNode new];

NSMutableDictionary *d = [NSMutableDictionary new];

[d setObject:@"A" forKey:n1];
[d setObject:@"B" forKey:n2];


if ([d objectForKey:n1]) {
    NSLog(@"true");
}
</code></pre>

<p>I'm using SKNode as keys in NSDictionary.  I need to test if a given SKNode exists as a Key.  The common approaches for testing don't seem to work, as above the result will not return (or print) "true".  Neither will the following code:</p>

<pre><code>if ([d allKeys] containsObject:n1]) {
    NSLog(@"true");
}
</code></pre>

<p>If I make the keys strings; i.e @"key1", @"key2", "true" is printed.</p>

<p>Is it possible to test in this manner?</p>