title: Difference between retain
body: <p>what's the difference between these retains?:</p>
  
  <pre><code>@property (nonatomic, retain) NSString *A_StringToRetain;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>NSString *B_StringToRetain;
  B_StringToRetain = [[MyClass GetStringValue] retain];
  </code></pre>
  
  <p>Because using property, string won't retain and using second ways, all ok, but i need to check and release to avoid leaks.</p>
  
  <hr>
  
  <p><strong>Example</strong>:<br>
  I declared in <code>.h</code>  </p>
  
  <pre><code>NSString *A_StringToRetain;
  @property (nonatomic, retain) NSString *A_StringToRetain;
  </code></pre>
  
  <p>in <code>.m</code> i use  </p>
  
  <pre><code>A_StringToRetain = @"MyValue";
  </code></pre>
  
  <p>but when i exit from method, I lost <code>A_StringToRetain</code>. It's a zombie.</p>
  
  <p>If i not use a property and declare a string in this way  </p>
  
  <pre><code>NSString *B_StringToRetain;
  B_StringToRetain = [[MyClass GetStringValue] retain];
  </code></pre>
  
  <p>the string is in memory.</p>
  
  <hr>
  
  <p>Anyone tell me why please?<br>
  It's not the same way to alloc/retain?<br>
  What's differences?  </p>
  
  <p>thanks.</p>