Re: Create an NSCharacterSet constant
Re: Create an NSCharacterSet constant
- Subject: Re: Create an NSCharacterSet constant
- From: John Joyce <email@hidden>
- Date: Mon, 2 Nov 2009 00:41:13 -0600
On Nov 2, 2009, at 12:04 AM, Graham Cox wrote:
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
Indeed this is the point of Categories.
_______________________________________________
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