title: Key Value Coding for `description` property - Is this completely idiotic?
body: <p>I am jumping into a codebase that I'm unfamiliar with to resolve a critical crash, so I'm interested in finding a quick fix for the problem below that I can patch and come back to refactor later.</p>
  
  <p>There is a strong coupling between the JSON structure returned by the web service and the Objective-C domain objects. The problem is that the JSON has a key <code>description</code> which is already declared as part of the <code>NSObject</code> protocol.</p>
  
  <p>JSON: </p>
  
  <pre><code>{
      "channel" : {
          "description" : "blah",
          "mount"       : "blah",
          "status"      : "blah"
      }
  }
  </code></pre>
  
  <p>Objective-C:</p>
  
  <pre><code>@interface ABCChannel : NSObject
  
  @property (nonatomic , strong) NSString *description;
  @property (nonatomic , strong) NSString *mount;
  @property (nonatomic , strong) NSString *status;
  
  @end
  </code></pre>
  
  <p>Not surprising, the parsing code uses KVC to shuttle values from JSON to ObjC instances. From what I can tell, for Swift interop Apple has changed the internals of <code>NSObject</code>'s <code>description</code> from a method to a <code>readonly</code> property. Clang emits this:</p>
  
  <blockquote>
    <p>warning: auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it will be synthesized 'readonly' via another property [-Wobjc-property-synthesis]</p>
  </blockquote>
  
  <p>Okay. So ,I see two options:</p>
  
  <ol>
  <li><p>(Preferred) Change the name of the property from <code>description</code> to something else. The problem is the parser will throw an exception in <code>setValue:forKey:</code> because of the undefined <code>description</code> key.</p></li>
  <li><p>Back the <code>description</code> property with an instance variable using <code>@synthesize description = _channelDescription;</code></p></li>
  </ol>
  
  <hr>
  
  <p>I see option #1 as taking a step in the direction of the inevitable future refactor, and I would like to set myself up for that, if possible. I can fix the KVC problem with <code>ABCChannel</code> class no longer being compliant for the <code>description</code> key with the following code:</p>
  
  <pre><code>- (id)valueForUndefinedKey:(NSString *)key
  {
      if ([key isEqualToString:@"description"]) {
          return [self valueForKey:@"details"];
      }
  
      return [super valueForUndefinedKey:key];
  }
  
  - (void)setValue:(id)value forUndefinedKey:(NSString *)key
  {
      if ([key isEqualToString:@"description"]) {
          [self setValue:value forKey:@"details"];
      }
      else {
          [super setValue:value forUndefinedKey:key];
      }
  }
  </code></pre>
  
  <p><strong>I am wondering if this is a terrible idea that will cause problems, and if I should just back the <code>description</code> property with an ivar and completely address the refactor later.</strong></p>