title: Creating a transient relational property
body: <p>I think this is a simple issue but I have somehow leaked object in core data. I have a simple one to one relation in core data.</p>
  
  <pre><code>       Person           &lt;--------&gt;         Address
  
          -name                                -city
          -email                               -country
  </code></pre>
  
  <p>The person model was relatively simple with just few attributes. But, I wanted to add the getter in Person class to access the city and country from the person class itself. So, I did something like,</p>
  
  <pre><code>@interface Person:NSManagedObject
      @property(nonatomic, strong) NSString *name;
      @property(nonatomic, strong) NSString *email;
      @property(nonatomic, strong) Address *address;
      -(NSString*)city;
      -(NSString*)country;
  @end
  
  
  @implementation Person
    -(NSString*)city{
       [self willAccessValueForKey:@"address"];
       NSString *c = [self valueForKeyPath:@"address.city"];
       [self didAccessValueForKey:@"address"];
     }
  
     -(NSString*)country{
       [self willAccessValueForKey:@"address"];
       NSString *c = [self valueForKeyPath:@"address.country"];
       [self didAccessValueForKey:@"address"];
     }
  
  @end
  </code></pre>
  
  <p>With these getter I have been able to access the city with just simple getters in Person model as;</p>
  
  <pre><code>    person.city   and  person.country
  </code></pre>
  
  <p>But, I feel this is not the correct way to do it. How do I implement this feature to ensure that the memory is not leaked.</p>