Re: labelling some NSString objects, without making a new class?
Re: labelling some NSString objects, without making a new class?
- Subject: Re: labelling some NSString objects, without making a new class?
- From: Alex Lock <email@hidden>
- Date: Wed, 1 Oct 2003 11:34:35 -0400
On Wednesday, October 1, 2003, at 09:20 AM, Ben Dougall wrote:
rather than creating a new class that does nothing but simply wrap
around an NSString giving a different identity from a normal NSString
instance, is there a better, more efficient way of labelling NSString
objects to enable distinguishing between instances of the normal
NSString type and instances of the labelled NSString type? just seems
a bit wasteful to do that with a new object type - that'll result in
two objects per labelled object.
At runtime you wouldn't be creating "two objects"...
You'd be creating one object with your new properties + inheritance
from parents.
When you create a (normal) NSString, it doesn't create an NSObject
first it just creates an NSString. Likewise, if you were to
instantiate a "myString" object, you would only be creating THAT object
(with parent properties). This is the whole basis for object-oriented
programming:)
Out of curiosity (and perhaps to offer some help) what is it that
you're trying to accomplish where you'd need to be able to identify a
string by anything other than variable name or array/dictionary
location?
Thanks,
Alex <email@hidden>
_______________________________________________
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.