• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: copy and deepcopy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy and deepcopy


  • Subject: Re: copy and deepcopy
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 23 Apr 2002 01:45:23 +0200

On Monday, April 22, 2002, at 11:50 , Robert Lee Dotson wrote:

@interface LCVMatrix : NSObject {
int rows,
columns;
float *values;
}

...
@end

If I send [myMatrix copy], will I get two objects with pointers to the same data (values)? Or will I get two objects with distinct yet identical copies of the data? Or will I just crash with a sigbus?

Depends on how you have programmed the -copy method, which is exactly what you want to do with a new class, if its instances should be copiable.

(Actually the thing again ends with RTFM, this time the NSCopying protocol)
.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: copy and deepcopy
      • From: Andy Lee <email@hidden>
References: 
 >copy and deepcopy (From: Robert Lee Dotson <email@hidden>)

  • Prev by Date: Re: Create an IB "Informational Text" field Programatically
  • Next by Date: DO and connecting to hostNames
  • Previous by thread: copy and deepcopy
  • Next by thread: Re: copy and deepcopy
  • Index(es):
    • Date
    • Thread