title: copy an object in objective-c
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1459598/how-to-copy-an-object-in-objective-c">How to copy an object in objective c</a>  </p>
  </blockquote>
  
  
  
  <p>I have a very basic question.
  I would like to copy an object. So duplicate it.</p>
  
  <p>It is like:</p>
  
  <pre><code>    ProductEntity *pCopy = [[ProductEntity alloc]init];
      ProductEntity *pTemp = [[ProductEntity alloc]init];
      pCopy = [sourceArray objectAtIndex:[sourceCoverFlow selectedCoverIndex]];
      [pTemp setBalance:pCopy.balance];
      [pTemp setAvailableBalance:pCopy.availableBalance];
      [pTemp setProductType:pCopy.productType];
      [pTemp setProductTypeDesc:pCopy.productTypeDesc];
      [pTemp setIsCorpAccount:pCopy.isCorpAccount];
      [pTemp setIndex:pCopy.index];
      [pTemp setAlias:pCopy.alias];
      [pTemp setSaveAccount:pCopy.saveAccount];
      [pTemp setAccount:pCopy.account];
  </code></pre>
  
  <p>So, pTemp is a new Object which is a copy of pCopy?</p>
  
  <p>if I modify something of pTemp, will pCopy be modified?</p>
  
  <p>Thnks</p>