Re: Create an NSCharacterSet constant
Re: Create an NSCharacterSet constant
- Subject: Re: Create an NSCharacterSet constant
- From: Graham Cox <email@hidden>
- Date: Mon, 2 Nov 2009 17:04:58 +1100
On 02/11/2009, at 4:50 PM, John Joyce wrote:
Category, yeah, that's totally one way I thought about, but I was
thinking more of an enhancement request in Radar. I figured the
nature of it inheriting from NSObject implies there are some kind of
optimizations under the hood (otherwise we'd just use NSString and
NSScanner right?).
Seems like a useful one considering the
characterSetWithCharactersInString: method. Even if it were some
sort of singleton class. Particularly useful in input validation
routines (things like highly structured serial numbers and other
identifiers, etc...)
If there is consensus from multiple people on an enhancement request
and the functionality and justification for it, I'll be happy to
file it.
What is your proposed character set going to contain? Is it of ultra-
widespread utility?
Otherwise, this is what categories are for - to add enhancements
yourself in a few moments instead of waiting (possibly years) for
Apple to do it for you. I don't really see that there is a case here
for a radar enhancement request, but it would depend on what you have
in mind.
As for optimisations, I don't quite follow your argument -
NSCharacterSet is not equivalent to NScanner + NSString, though it
sometimes will get used with those classes. I expect the common built-
in "constant" sets are there because they are of very widespread
utility - e.g. stripping whitespace, but are probably not using much
in the way of magic optimisations.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden