naming variables on the fly
naming variables on the fly
- Subject: naming variables on the fly
- From: Peter Browne <email@hidden>
- Date: Wed, 8 Jun 2005 09:43:32 +0100
I apologize if this is a silly question, but I was wondering if/how it
is possible to dynamically name variables as they are created. For
instance, normally you would choose the name for a variable like
int i;
or NSString *aString;
but is there any way to program a situationally dependent replacement
for "i" or "aString". The only situation i can think of for this is if,
for some reason, you needed to initialize a varying number of objects
belonging to a custom class. Orr as a time saving measure, for instance
if you wanted to initialize 20 different NSArrays could you do
something along the lines of a:
for (someNumber = 0; someNumber <= 20; someNUmber++)
{
NSArray *aDifferentNameEachTime = [[NSArray alloc] init];
}
Any thoughts?
Pete
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden