Re: copy and deepcopy
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.