NSInvalidArgumentException/copyWithZone exception with NSMutableDictionary
<p>I have a class that I'm encapsulating ABRecordID with and when it's used as a key to add to an NSMutableDictionary, I get the run-time exception:</p>

<blockquote>
  <p>"NSInvalidArgumentException: ***
  -[MyRecordId copyWithZone:]: unrecognized selector sent to
  instance"</p>
</blockquote>

<p>MyRecordId declared as:</p>

<pre><code>@interface MyRecordId : NSObject {
    ABRecordID abRecordId;
}

-(id)initWithId:(ABRecordID)anABRecordId;
@property (nonatomic) ABRecordID abRecordId;

@end
</code></pre>

<p>Adding to dictionary:</p>

<pre><code>NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
MyRecordId *recordId = [[MyRecordId alloc] initWithId:anABRecordId];
[dict setObject:@"hello" forKey:recordId];
</code></pre>

<p>The last line causes the exception.. I know that you can't store non-object types as keys for a dictionary but I thought that wrapping it up in NSObject derived class would make it okay.</p>

<p>Am I not supposed to store ABRecordID in other objects? Should I be doing something else?</p>
