Re: Retain counts with a dictionary
Re: Retain counts with a dictionary
- Subject: Re: Retain counts with a dictionary
- From: Angela Brett <email@hidden>
- Date: Sun, 16 Mar 2003 15:02:37 +1200
2. Is it okay to use @"" for the objects in the loop? Will that
create a new null string for each addition, or reuse the same one?
Is there a better way?
Like others have already said, for your purposes an NSMutableSet is
probably better. But you would probably find it useful to know that
there is an object especially made for putting into collections where
you would want to put nil - NSNull. NSNull is a singleton so you know
for sure that it will be putting the same one in there each time - in
fact, you can even use == to compare an object with [NSNull null]
instead of using isEqual:
It's just a bit nicer than using empty strings, especially if you
wanted an empty string to mean something other than the absence of
any value.
--
Angela Brett
email@hidden
http://acronyms.co.nz/angela
_______________________________________________
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.