title: Error while sorting with sortedArrayUsingDescriptors : "class is not key value coding-compliant for the key"
body: <p>I have an unordered array of instances of the following class:</p>
  
  <pre><code>@interface Place : NSObject {
  
  }
  
  @property (nonatomic, copy) NSString *country;
  @property (nonatomic, copy) NSString *city;
  @property (nonatomic, retain) NSURL   *imageURL;
  
  - (id) initWithCountry:(NSString *)aCountry 
                   city:(NSString *)aCity 
               imageUrl:(NSURL * aUrl;
  
  @end
  </code></pre>
  
  <p>I'm trying to sort it using <em>sortedArrayUsingDescriptors</em> :</p>
  
  <pre><code>NSMutableSet *bag = [[[NSMutableSet alloc] init] autorelease];
  [bag addObject:[[Place alloc] initWithCountry:@"USA" 
                                           city:@"Springfield" 
                                       imageUrl:[NSURL URLWithString:@"http://www.agbo.biz"]]];
  [bag addObject:[[Place alloc] initWithCountry:@"Afghanistan" 
                                           city:@"Tora Bora" 
                                       imageUrl:[NSURL URLWithString:@"http://www.agbo.biz"]]];
  [bag addObject:[[Place alloc] initWithCountry:@"USA" 
                                           city:@"Chicago" 
                                       imageUrl:[NSURL URLWithString:@"http://www.agbo.biz"]]];
  
  [bag addObject:[[Place alloc] initWithCountry:@"USA" 
                                           city:@"Chicago" 
                                       imageUrl:[NSURL URLWithString:@"http://www.google.com"]]];
  
  
  NSSortDescriptor *country = [[[NSSortDescriptor alloc] initWithKey:@"country" 
                                                           ascending:YES]autorelease];
  
  NSSortDescriptor *city = [[[NSSortDescriptor alloc] initWithKey:@"city"
                                                        ascending:YES] autorelease];
  // this is were everything goes wrong 
  NSSortDescriptor *url = [[[NSSortDescriptor alloc] initWithKey:@"imageUrl" 
                                                       ascending:YES] autorelease]; 
  
  NSArray *sorted = [bag sortedArrayUsingDescriptors:[NSArray arrayWithObjects: country, city, nil]];
  </code></pre>
  
  <p>If I try to use the imageUrl property to sort, I get a rather strange error:</p>
  
  <blockquote>
    <p><em>*</em> Terminating app due to uncaught exception 'NSUnknownKeyException',
    reason: '[
    valueForUndefinedKey:]: this class is
    not key value coding-compliant for the
    key imageUrl.'</p>
  </blockquote>
  
  <p>That property is synthesized just like the other two, so I would expect the 3 to be key-value compliant. </p>
  
  <p>What's going on?</p>