Re: Overriding -copyWithZone: the right way
Re: Overriding -copyWithZone: the right way
- Subject: Re: Overriding -copyWithZone: the right way
- From: Steven Kramer <email@hidden>
- Date: Sat, 6 Nov 2004 08:52:30 +0100
I think one fine point has been missed until now (not sure what the
Apple docs have to say on it). If you derive from NSObject, you should
not call [[MyClass alloc] init] but [[[self class] alloc] init] to get
an instantiation of the right subclass. This might be causing your
problems...
Regards
Steven
--
email@hidden
http://sprintteam.nl/
Op 6-nov-04 om 0:27 heeft Jean-Olivier Lanctôt het volgende geschreven:
Well I just learned a new thing...
anyway, I have this very WEIRD crash in my app (which is, BTW, the
ONLY bug left until I can release 1.0) that I just can't squash.
*Maybe* it has to do with my wrong manner of overriding copyWithZone??
What do you guys think.. I have something like 5 custom classes
implementing it and I don't do it the right way... so could that be
the reason for weird crashes? I'm not on my work comp. right now so I
can't check.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden