Re: Casting to a superclass
Re: Casting to a superclass
- Subject: Re: Casting to a superclass
- From: Rob Rix <email@hidden>
- Date: Mon, 16 Jul 2001 11:06:29 -0400
You can actually do both, but casting won't change the internal
representation of the set and it will thus keep its mutability. If you
really want to preserve it, use the later approach. Also note that users
of your API shouldn't try to add objects to the returned set if it's said
to be immutable. For this reason, I believe the former approach is widely
accepted and used...
Ah, okay, thanks.
For my purposes, I'm probably going to return a new, autoreleased set.
Thanks very much,
-- Rob
Flying is the sustained art of falling sideways without letting physics
catch on to what you're up to.