DO NOT DO THIS.
-init... is a one-time operation in Cocoa. The call is privileged to make
>destructive initializations to the object, to assume that its initial
state
>can be ignored, and even to replace the object entirely. Subsequent
-init...
calls will in turn assume they can make destructive initializations, and the
>object will almost certainly (maybe not today, maybe not tomorrow, but
soon,
>and for the rest of its life) break.
Fair point, and well noted. I think it's a shame that objects would be
so cavalier about their existing state (isn't that just sloppy? Makes it
far too easy to leak memory) but there *is* some logic to the whole
-initXXX thing being destructive and if that's the way it's done... so
be it. Glad I learned this now rather than *after* a problem...
--
Jason Teagle
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com